Skip to content

Commit 6290f2a

Browse files
author
Mike Storey
committed
Docker improvements - production build, container name fix
1 parent eb49306 commit 6290f2a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ COPY --from=build /app/ /opt/stage0_mongodb_api/
2424
COPY Pipfile Pipfile.lock /opt/stage0_mongodb_api/
2525
RUN pip install pipenv && pipenv install --deploy --system
2626

27-
# Install the package in development mode
28-
RUN pip install -e .
29-
3027
# Install Gunicorn for running the Flask app in production
3128
RUN pip install gunicorn
3229

@@ -35,6 +32,7 @@ EXPOSE 8081
3532

3633
# Set Environment Variables
3734
ENV PYTHONPATH=/opt/stage0_mongodb_api/stage0_mongodb_api
35+
ENV MONGODB_API_PORT=8081
3836

3937
# Command to run the application using Gunicorn
40-
CMD exec gunicorn --bind 0.0.0.0:8081 --timeout 120 --preload stage0_mongodb_api.server:app
38+
CMD exec gunicorn --bind 0.0.0.0:${MONGODB_API_PORT} --timeout 120 --preload stage0_mongodb_api.server:app

docker-compose.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
# MongoDB configuration Service
2727
##################################
2828
mongodb_api:
29-
image: ghcr.io/agile-learning-institute/stage0_mongo_api:latest
29+
image: ghcr.io/agile-learning-institute/stage0_mongodb_api:latest
3030
restart: no
3131
ports:
3232
- 8081:8081
@@ -35,6 +35,7 @@ services:
3535
AUTO_PROCESS: False
3636
LOAD_TEST_DATA: True
3737
MONGO_DB_NAME: test_database
38+
MONGODB_API_PORT: 8081
3839
volumes:
3940
- ${INPUT_FOLDER:-./tests/test_cases/large_sample}:/input
4041
depends_on:
@@ -48,7 +49,7 @@ services:
4849
image: ghcr.io/agile-learning-institute/stage0_mongodb_spa:latest
4950
restart: no
5051
environment:
51-
MONGODB_API_HOST: stage0_mongodb_api
52+
MONGODB_API_HOST: mongodb_api
5253
MONGODB_API_PORT: 8081
5354
MONGODB_SPA_PORT: 8082
5455
ports:

0 commit comments

Comments
 (0)