Files
endurain/Dockerfile_backend
João Vitória Silva cef2064eaa Backend requirements bump
[README] README file updated
[frontend] Updated dockerfile for frontend image
[backend] Updated dockerfile for backend image
[backend] Removed .env file. Env variables loaded on docker build process
[frontend] Fixed .env file for frontend docker image
[frontend] Added nginx-custom.conf to fix reloads
[frontend] Added frontend_env.sh to fix env variables loading on docker image start
[docker] Updated docker compose example file
2024-05-23 09:58:24 +01:00

47 lines
1.3 KiB
Plaintext

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_HOST="frontend"
ENV GEOCODES_MAPS_API="changeme"
# Run main.py when the container launches
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]