Skip to content

Commit

Permalink
some docker stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
PazBazak committed Dec 28, 2020
1 parent 5b3cd34 commit c4082b7
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
5 changes: 0 additions & 5 deletions ATM_api/requirements.txt

This file was deleted.

22 changes: 18 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@ FROM python:3.8-alpine
ENV PATH="/scripts:${PATH}"

COPY ./requirements.txt /requirements.txt

RUN apk add --update --no-cache --virtual .tmp gcc libc-dev linux-headers

RUN pip install -r /requirements.txt

RUN apk del .tmp

RUN mkdir /ATM
RUN mkdir /ATM-api
COPY ./ATM_api /ATM_api
WORKDIR /ATM_api
COPY ./scripts /scripts

RUN chmod +x /scripts/*

RUN mkdir -p /vol/web/media
RUN mkdir -p /vol/web/static

RUN adduser -D user
RUN chown -R user:user /vol
RUN chmod -R 755 /vol/web
USER user

CMD ["entrypoint.sh"]



13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.7'

services:
app:
build:
context: .
ports:
- "8000:8000"
volumes:
- ./ATM_api:/ATM_api
command: sh -c "python manage.py runserver 0.0.0.0:8000"
environment:
- DEBUG=1
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Django==3.1.4
djangorestframework==3.12.2
pytz==2020.5
sqlparse==0.4.1
uWSGI>=2.0.18
8 changes: 8 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

python manage.py collectstatic --noinput

uwsgi --socket :8000 --master --enable-threads --module ATM.wsgi

0 comments on commit c4082b7

Please sign in to comment.