Skip to content

Commit 6c6e168

Browse files
Merge pull request #3 from epicseven-cup/feature/fix-prod-docker
fixed prod docker failing to run due to missing packages
2 parents 029a12e + e4b86cb commit 6c6e168

File tree

6 files changed

+13
-24
lines changed

6 files changed

+13
-24
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
A Flask API server that handles enqueuing and dequeuing students from the office hours queue.
77

88
# Quick Started
9-
1. You will first need to install all the development packages mainly use for
9+
1. You will first need to install all the development packages mainly use for, it will allow you to run tools locally for the project.
10+
```bash
11+
pip install -r utils.txt
12+
```
1013

1114
# Project structure
1215
[//]: # (TODO: Going to do a markdown of a file structure here so that you can see the project structure)
@@ -15,13 +18,11 @@ A Flask API server that handles enqueuing and dequeuing students from the office
1518
For this project please use the following python version:
1619
`"3.10", "3.11", "3.12"`
1720

18-
1921
Running the development server:
2022
```bash
2123
docker compose up api-development --build
2224
```
2325

24-
2526
# Pylint
2627
Project uses pylint to keep the code style organized
2728

@@ -37,8 +38,7 @@ Using the Black formatter https://github.com/psf/black
3738
black $(git ls-files '*.py')
3839
```
3940

40-
4141
# Resource
4242
Good resources to look at:
4343
- https://flask.palletsprojects.com/en/stable/blueprints/
44-
- https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xv-a-better-application-structure
44+
- https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xv-a-better-application-structure

api/Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
FROM python:latest
22
LABEL authors="tomato"
33

4-
ARG API_MODE
5-
#This env is now re-used and set again within the container
6-
ENV API_MODE=$API_MODE
7-
84
WORKDIR app/
95

10-
COPY requirements_${API_MODE}.txt requirements.txt
6+
COPY requirements.txt .
117
COPY gunicorn.conf.py gunicorn.conf.py
128
RUN pip install -r requirements.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Flask
22
gunicorn
3+
requests

api/requirements_dev.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

api/utils.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pylint
2+
black

compose.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ services:
22
api-development:
33
build:
44
context: ./api/
5-
args:
6-
API_MODE: "dev"
5+
environment:
6+
API_MODE: "dev"
77
volumes:
88
- ./api:/app/api
99
ports:
1010
- "8000:8000"
1111
command: flask --app api.server:app run --debug --host=0.0.0.0 --port=8000
1212

13-
1413
api-production:
1514
extends:
1615
service: api-development
17-
build:
18-
args:
16+
environment:
1917
API_MODE: "prod"
2018
ports:
2119
- "8000:8000"
22-
command: gunicorn 'api.server:create_app()' # this probably doesn't work
20+
command: gunicorn 'api.server:create_app()'

0 commit comments

Comments
 (0)