diff --git a/.gitignore b/.gitignore index efb6152..adeba39 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ citysync/__pycache__/ *.pyc citysync/.env citysync/venv/ + +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7b17c6a..6908ba0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,21 @@ FROM python:3-alpine -# Exposes the default test development server on post 5000. -# Consumer needs to map to this port using either randon (-P) or single specific (-p) to docker run -EXPOSE 5000 - # Create directory for app install. Consider changes when we use NGINX or APACHE RUN mkdir -p /root/citysync/ ADD citysync /root/citysync/ -# Copy readymade data seeded TEST sqlite3 database. Consider changes when we use PostgreSQL -COPY database-devel.sqlite3 /root/citysync/ +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 # Install the requirements. Need a base version of python 3.6 at the least. WORKDIR /root/citysync/ RUN pip install -r requirements.txt +# Exposes the default test development server on post 5000. +# Consumer needs to map to this port using either randon (-P) or single specific (-p) to docker run +EXPOSE 5000 + # Start the development server ENTRYPOINT [ "python3" ] CMD ["-u", "manage.py" ] diff --git a/citysync/database-devel.sqlite3 b/citysync/database-devel.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d0b8b79 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3' +services: + api: + build: . + # depends_on: + # - db + # links: + # - "db: database" + ports: + - '5000:5000' + command: python manage.py + # volumes: + # - ./citysync/:/root/citysync + # env_file: .env + # db: + # image: postgres + # restart: always + # environment: + # - POSTGRES_USER=${DATABASE_USER} + # - POSTGRES_PASSWORD=${DATABASE_PASSWORD} \ No newline at end of file