From 74c74df761c0e9f1a924d71d70531fd29cba36a6 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 25 Jul 2019 16:03:00 +0800 Subject: [PATCH] update: compose add nginx as proxy --- Dockerfile | 8 ++++---- docker-compose.yml | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index e560b35..33c4f5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,21 +3,21 @@ FROM node:lts-alpine AS builder LABEL maintainer="llitfkitfk@gmail.com" -RUN npm install -g typescript +RUN yarn global add typescript WORKDIR /app # cache dependencies COPY package.json ./ -RUN npm install +RUN yarn install # build COPY . ./ -RUN npm run build +RUN yarn run build # RUNNING FROM node:lts-alpine LABEL maintainer="llitfkitfk@gmail.com" WORKDIR /app -COPY --from=builder /app/dist/* ./ +COPY --from=builder /app/dist . COPY --from=builder /app/node_modules ./node_modules \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 474fb91..b9ac341 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,13 +5,17 @@ version: "3" services: # frontend - dolores: + nginx: + # image: nginx:stable-alpine build: # will use image from the frontend repo in the future context: docker/frontend - command: serve -s /app -p 80 + volumes: + - ./docker/nginx/conf.d:/etc/nginx/conf.d ports: - - 38081:80 + - 38080:38080 + - 38081:38081 + # backend delos: # build from ./Dockerfile @@ -43,8 +47,6 @@ services: depends_on: - redis - mysql - ports: - - "38080:8080" # expose 38080 redis: image: redis:4