diff --git a/Dockerfile b/Dockerfile index fe1e1ec..29ba4c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ -FROM node:18-slim -ADD . /gc_tools -WORKDIR /gc_tools -RUN ["yarn", "install"] -RUN ["yarn", "run", "build"] -CMD ["yarn","global","add","serve"] -CMD ["serve", "-s", "build"] -EXPOSE 3000 \ No newline at end of file +FROM node:18-alpine as builder +WORKDIR /app +COPY package.json package.json +COPY yarn.lock yarn.lock +RUN yarn install --production +COPY . . +RUN yarn build +FROM nginx:alpine +WORKDIR /usr/share/nginx/html +RUN rm -rf * +COPY --from=builder /app/build . +ENTRYPOINT ["nginx","-g","daemon off;"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8a1ddb1..4b6dfe1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,14 +2,9 @@ version: '3.8' services: gc_tools: container_name: gc_tools - command: yarn start build: context: . dockerfile: Dockerfile - volumes: - - .:/gc_tools - - /gc_tools/node_modules - - /gc_tools/build environment: - VIRTUAL_HOST=gc-tools.exzork.me - LETSENCRYPT_HOST=gc-tools.exzork.me