Skip to content

Commit d501e6e

Browse files
committed
add dockerfile.prod
1 parent a88a9d7 commit d501e6e

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ EXPOSE 8080
1414

1515
COPY app/ ./
1616

17-
CMD ["sh", "-c", "uvicorn main:app --reload --host 0.0.0.0 --port 8080"]
17+
CMD ["sh", "-c", "uvicorn main:app --reload --host 0.0.0.0 --port 8080 & python main_rabbitmq.py"]

Dockerfile.prod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM python:3.11-slim-buster
2+
3+
WORKDIR /app
4+
5+
RUN apt-get update \
6+
&& apt-get -y install libpq-dev gcc \
7+
&& pip install psycopg2
8+
9+
COPY requirements.txt ./
10+
11+
COPY entrypoint-heroku.sh /
12+
13+
RUN pip install -r requirements.txt
14+
15+
EXPOSE 8080
16+
17+
COPY app/ ./
18+
19+
CMD ["/entrypoint-heroku.sh"]

entrypoint-heroku.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
poetry run uvicorn app.main:app --host 0.0.0.0 --port 8080
3+
poetry run uvicorn main:app --host 0.0.0.0 --port 8080

heroku.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
build:
22
docker:
3-
web: Dockerfile
3+
web: Dockerfile.prod

0 commit comments

Comments
 (0)