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
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.11.4

WORKDIR /app

# Copy the requirements.txt first to leverage Docker cache
COPY requirements.txt .

# Install the Python dependencies
RUN pip install -r requirements.txt

# Install Doppler CLI
RUN curl -Ls https://cli.doppler.com/install.sh | sh

# # Copy the rest of the application code from the 'app' directory
# COPY app/ .
# COPY app/ /app/
# COPY . /app/

EXPOSE 8000

# Use Doppler to inject environment variables and start the application
ENTRYPOINT ["doppler", "run", "--"]
CMD ["uvicorn", "main:app", "--reload"]

# Use the command below if you want to run with gunicorn
# CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "main:app", "--bind", "0.0.0.0:8000", "--timeout", "120"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
app:
build: .
container_name: tax-app-api-v0
ports:
- "8000" # Map port 8080 on the host to 8000 in the container
volumes:
- ./app:/app # Map the local 'app' directory to '/app' in the container
environment:
- DOPPLER_TOKEN
entrypoint: ["doppler", "run", "--"]
# The command here overrides the CMD in Dockerfile, use with caution
# command: uvicorn main:app --reload
command: ["uvicorn", "main:app", "--reload"]
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"deploy": "git push heroku dev:master",
"install": "pip install -r requirements.txt",
"logs":"heroku logs --tail",
"docker": "",
"docker:up": "docker-compose up -d",
"docker:down": "docker-compose down",
"docker:build": "docker-compose build",
"test": "yarn test:all",
"test:all": "yarn test:app && yarn test:db && yarn test:models && yarn test:services && yarn test:controllers",
"test:app": "PYTHONPATH=./app pytest tests/test_app.py",
Expand Down