Compare commits
1 commit
stable
...
jedi/dev/d
Author | SHA1 | Date | |
---|---|---|---|
37350f59c3 |
3 changed files with 83 additions and 0 deletions
54
deploy/docker-compose.prod.yml
Normal file
54
deploy/docker-compose.prod.yml
Normal file
|
@ -0,0 +1,54 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ../backend/
|
||||
dockerfile: ../deploy/dev/Dockerfile.backend
|
||||
volumes:
|
||||
- ../backend:/code
|
||||
expose:
|
||||
- 8000
|
||||
command: bash -c "python configure.py; python configure.py testdata; python manage.py runserver 0.0.0.0:8000 --insecure"
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ../frontend/
|
||||
dockerfile: ../deploy/dev/Dockerfile.frontend
|
||||
volumes:
|
||||
- ../frontend:/app
|
||||
expose:
|
||||
- 5173
|
||||
command: npm run dev -- --host
|
||||
|
||||
wiki:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: deploy/dev/Dockerfile.wiki
|
||||
volumes:
|
||||
- ../mkdocs.yml:/wiki/mkdocs.yml
|
||||
- ../docs:/wiki/docs
|
||||
expose:
|
||||
- 8001
|
||||
command: mkdocs serve --dev-addr=0.0.0.0:8001
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
volumes:
|
||||
- ./dev/fullchain.pem2:/etc/nginx/nginx.crt
|
||||
- ./dev/privkey.pem2:/etc/nginx/nginx.key
|
||||
- ./dev/nginx-instance_a.dev.conf:/etc/nginx/nginx.conf
|
||||
- ./dev/dns.json:/var/www/dns.json
|
||||
- ./dev/domains.json:/var/www/domains.json
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 5353:5353
|
||||
|
||||
dns:
|
||||
build:
|
||||
context: ./dev/
|
||||
dockerfile: Dockerfile.dns
|
||||
volumes:
|
||||
- ./dev/zone.json:/dns/zone.json
|
||||
expose:
|
||||
- 8053
|
15
deploy/prod/Dockerfile.frontend
Normal file
15
deploy/prod/Dockerfile.frontend
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Use an official Node.js runtime as instance_a parent image
|
||||
FROM node:14
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install app dependencies
|
||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
COPY package.json ./
|
||||
|
||||
RUN npm install
|
||||
# If you are building your code for production
|
||||
# RUN npm ci --only=production
|
||||
|
||||
CMD [ "npm", "run", "dev", "--", "--host"]
|
14
deploy/prod/Dockerfile.frontend.prod
Normal file
14
deploy/prod/Dockerfile.frontend.prod
Normal file
|
@ -0,0 +1,14 @@
|
|||
ROM node:alpine as builder
|
||||
WORKDIR /app
|
||||
COPY ./package.json /app/package.json
|
||||
COPY . /app
|
||||
RUN npm ci --only=production
|
||||
RUN npm run build
|
||||
|
||||
|
||||
FROM nginx:alpine as runner
|
||||
#RUN apk add --update npm
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
Loading…
Reference in a new issue