diff --git a/docker-compose.yml b/docker-compose.yml index 3e26f501..331570f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - ./services/api/.env:/service/.env - ./services/api/openapi:/service/openapi ports: - - '2300:2300' + - "2300:2300" links: - mongo depends_on: @@ -24,13 +24,14 @@ services: web: build: context: ./services/web + dockerfile: Dockerfile.dev args: NODE_ENV: development command: yarn start volumes: - ./services/web/src:/service/src ports: - - '2200:2200' + - "2200:2200" depends_on: - api diff --git a/services/web/Dockerfile.dev b/services/web/Dockerfile.dev new file mode 100644 index 00000000..51fafff7 --- /dev/null +++ b/services/web/Dockerfile.dev @@ -0,0 +1,20 @@ +FROM node:20.12.2-alpine + +# Note layers should be ordered from less to more likely to change. + +# Update & install required packages +RUN apk add --update bash curl; + +# Set work directory +WORKDIR /service + +# Copy app source +COPY . . + +RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --frozen-lockfile + + +EXPOSE 2200 + +CMD ["yarn", "start"] + \ No newline at end of file