From 5561abb6196d9616f4a5a66934f337b46a52d000 Mon Sep 17 00:00:00 2001 From: xingzi Date: Thu, 11 Jan 2024 15:34:24 +0800 Subject: [PATCH] context copy --- docker-compose.yaml | 10 +++------- docker/Dockerfile | 7 +++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f43b585..0fb7efb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,14 +3,10 @@ version: "3" services: frontend: build: - context: ./docker - dockerfile: Dockerfile + context: . + dockerfile: ./docker/Dockerfile image: eladmin-frontend:latest container_name: eladmin-frontend - command: ["cp", "./dist", "/usr/share/nginx/html"] - restart: always + # restart: always ports: - "8282:80" - volumes: - # - ./docker/conf/conf.d:/etc/nginx/conf.d - # - ./dist:/usr/share/nginx/html diff --git a/docker/Dockerfile b/docker/Dockerfile index 3b4786a..0026c5b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,8 @@ FROM nginx:1.12 -# set timezome ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ No newline at end of file +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +COPY ./docker/conf/nginx.conf /etc/nginx/nginx.conf +COPY ./docker/conf/conf.d/default.conf /etc/nginx/conf.d/default.conf +COPY ./dist /var/www/html \ No newline at end of file