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: volumes:
- ./front:/front - ./front:/front
- /front/node_modules/ - /front/node_modules/
environment: environment:
HOST: 0.0.0.0 HOST: 0.0.0.0
server: server:
build: ./server build: ./server
ports: command: python manage.py runserver 0.0.0.0:8000
- 8080:8080
volumes: volumes:
- ./server:/server - ./server:/code
- /server/node_modules/ ports:
environment: - "8000:8000"
- 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

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/