Merge pull request #56 from wulkanowy/feature/docker-support

Add docker support
This commit is contained in:
Tomasz F 2021-04-07 11:06:19 +02:00 committed by GitHub
commit 5dcb6ed72e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 0 deletions

2
.Dockerignore Normal file
View file

@ -0,0 +1,2 @@
__pycache__
node_modules

34
Dockerfile Normal file
View file

@ -0,0 +1,34 @@
FROM nikolaik/python-nodejs:python3.9-nodejs15
ENV PYTHONUNBUFFERED 1
WORKDIR /src
COPY frontend/package-lock.json .
COPY frontend/package*.json ./frontend/
RUN npm install
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY app/* ./app/
COPY app/API/* ./app/API/
COPY app/migrations/* ./app/migrations/
COPY frontend/* ./frontend/
COPY frontend/src/* ./frontend/src/
COPY frontend/migrations/* ./frontend/migrations/
COPY frontend/static/frontend/* ./frontend/static/frontend/
COPY frontend/static/frontend/css/* ./frontend/static/frontend/css/
COPY frontend/static/frontend/images/* ./frontend/static/frontend/images/
COPY frontend/templates/frontend/* ./frontend/templates/frontend/
COPY wulkanowy/* ./wulkanowy/
COPY manage.py .
RUN python manage.py makemigrations
RUN python manage.py migrate
EXPOSE 8000
ENTRYPOINT [ "python3", "manage.py", "runserver", "0.0.0.0:8000" ]

View file

@ -26,3 +26,13 @@ And in frontend:
```shell
npm run dev
```
# Docker
## With docker compose
```shell
docker-compose up -d
```
## Without docker compose
```shell
docker build -t wulkanowy/web .
docker run -d -p 8000:8000 wulkanowy/web

7
docker-compose.yml Normal file
View file

@ -0,0 +1,7 @@
version: '3.9'
services:
app:
container_name: wulkanowy_web
build: .
ports:
- "8000:8000"