feat: dockerization

This commit is contained in:
Alice 2022-04-03 01:20:53 +02:00
parent 134ef26662
commit e12a067959
2 changed files with 15 additions and 22 deletions

View file

@ -8,30 +8,14 @@ services:
volumes:
- ./front:/front
- /front/node_modules/
environment:
environment:
HOST: 0.0.0.0
server:
build: ./server
ports:
- 8080:8080
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./server:/server
- /server/node_modules/
environment:
- DATABASE_URL=mongo
- WAIT_HOSTS=mongo:27017
- PORT=8080
- DEBUG=dev
- NODE_ENV=development
- DB_NAME=dev
depends_on:
- database
database:
image: mongo
container_name: mongo
ports:
- 27017:27017
volumes:
- ./db:/data/db
- ./server:/code
ports:
- "8000:8000"

9
server/Dockerfile Normal file
View file

@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM python:3
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/