fix docker thing

This commit is contained in:
muhammadeko 2022-04-30 15:16:13 +07:00
parent 83c55f0d31
commit afc674592b
No known key found for this signature in database
GPG Key ID: 51366716C10E98B1
2 changed files with 12 additions and 13 deletions

View File

@ -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
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;"]

View File

@ -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