Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ citysync/__pycache__/
*.pyc
citysync/.env
citysync/venv/

.env
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
Empty file added citysync/database-devel.sqlite3
Empty file.
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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}