Skip to content

Commit

Permalink
Add Dockerfile & set IP:PORT config for listen
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulBernal committed Jun 6, 2024
1 parent 5ce58a9 commit 818e5b6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PORT=4200
HOST='0.0.0.0'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ typings/
.yarn-integrity

# dotenv environment variables file
.env
#.env

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG BASE_IMAGE=node:18-alpine3.18

# This is a multiple stage Dockerfile.

# - Stage 1: builder (adds dependencies, environment variables, and builds the project using yarn)

# - Stage 2: runner (final image for the web project, sets environment variables, starts the server)

################################################################################

# Stage: builder
FROM ${BASE_IMAGE} AS builder


### First install the dependencies (as they change less often)
COPY . /app

WORKDIR /app
## Setting up the environment variables for the docker container.

RUN yarn install
#--inline-builds

## Build the project
RUN yarn build

################################################################################

# Stage: runner
FROM builder AS runner

WORKDIR /app

CMD yarn preview

0 comments on commit 818e5b6

Please sign in to comment.