Skip to content

Commit b7ac5e1

Browse files
committed
Add depends_on
1 parent 5554bac commit b7ac5e1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

samples/django-channels-redis-postgres/app/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Use a smaller base image
2-
FROM python:3.10.4-slim-buster
2+
FROM python:3.10-slim-buster
33

44
# Set environment variables
5-
ENV PYTHONDONTWRITEBYTECODE 1
6-
ENV PYTHONUNBUFFERED 1
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONUNBUFFERED=1
77

88
# Set work directory
99
WORKDIR /app
1010

11-
RUN apt-get update && apt-get install -y \
12-
gcc \
13-
python3-dev \
14-
libpq-dev
11+
RUN apt-get update \
12+
&& apt-get install -y \
13+
gcc \
14+
python3-dev \
15+
libpq-dev
1516

1617
# Install dependencies
1718
COPY requirements.txt /app/

samples/django-channels-redis-postgres/compose.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ services:
1818
# wget or curl required for healthchecks on services with a published port
1919
# this gets parsed by Defang and provided to the load balancers as well
2020
test: ["CMD", "python3", "-c", "import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read()", "http://localhost:8000/"]
21+
depends_on:
22+
- redis-service
23+
- postgres-service
2124

2225
redis-service:
2326
image: redis:6.2

0 commit comments

Comments
 (0)