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 FROM node:18-alpine as builder
ADD . /gc_tools WORKDIR /app
WORKDIR /gc_tools COPY package.json package.json
RUN ["yarn", "install"] COPY yarn.lock yarn.lock
RUN ["yarn", "run", "build"] RUN yarn install --production
CMD ["yarn","global","add","serve"] COPY . .
CMD ["serve", "-s", "build"] RUN yarn build
EXPOSE 3000 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: services:
gc_tools: gc_tools:
container_name: gc_tools container_name: gc_tools
command: yarn start
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
volumes:
- .:/gc_tools
- /gc_tools/node_modules
- /gc_tools/build
environment: environment:
- VIRTUAL_HOST=gc-tools.exzork.me - VIRTUAL_HOST=gc-tools.exzork.me
- LETSENCRYPT_HOST=gc-tools.exzork.me - LETSENCRYPT_HOST=gc-tools.exzork.me