-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile_backend
49 lines (41 loc) · 1.38 KB
/
Dockerfile_backend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.11
# Links Docker image with repository
LABEL org.opencontainers.image.source https://github.com/joaovitoriasilva/endurain
# Set the working directory
WORKDIR /app
# Copy the requirements.txt file to /app
COPY requirements.txt /app
# Install any needed packages specified in requirements.txt and then remove requirements.txt file
# Remove any temporary files or directories created during the build process
# Cache Cleanup
RUN pip install --no-cache-dir --upgrade -r requirements.txt \
&& rm requirements.txt \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy the directory backend contents to /app
COPY backend /app
# Make port 80 available to the world outside this container
EXPOSE 80
# Define environment variables
ENV DB_HOST="mariadb"
ENV DB_PORT=3306
ENV DB_USER="endurain"
ENV DB_PASSWORD="changeme"
ENV DB_DATABASE="endurain"
ENV SECRET_KEY="changeme"
ENV ALGORITHM="HS256"
ENV ACCESS_TOKEN_EXPIRE_MINUTES=30
ENV STRAVA_CLIENT_ID="changeme"
ENV STRAVA_CLIENT_SECRET="changeme"
ENV STRAVA_AUTH_CODE="changeme"
ENV JAEGER_ENABLED="true"
ENV JAEGER_HOST="jaeger"
ENV JAEGER_PROTOCOL="http"
ENV JAGGER_PORT=4317
ENV STRAVA_DAYS_ACTIVITIES_ONLINK=30
ENV FRONTEND_PROTOCOL="http"
ENV FRONTEND_HOST="frontend"
ENV FRONTEND_PORT=8080
ENV GEOCODES_MAPS_API="changeme"
# Run main.py when the container launches
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]