-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13a1fa2
commit ecbf2a7
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
services: | ||
|
||
web: | ||
container_name: web_app_container | ||
image: drorganvidez/uvlhub:latest | ||
build: | ||
context: ../ | ||
dockerfile: docker/images/Dockerfile.render | ||
ports: | ||
- "5000:5000" | ||
restart: always | ||
volumes: | ||
- ./entrypoints/production_entrypoint.sh:/app/entrypoint.sh | ||
- ../scripts:/app/scripts | ||
- ../migrations:/app/migrations | ||
command: [ "sh", "-c", "sh /app/entrypoint.sh" ] | ||
|
||
db: | ||
container_name: mariadb_container | ||
image: mariadb:latest | ||
command: --default-authentication-plugin=mysql_native_password | ||
restart: always | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
|
||
nginx: | ||
container_name: nginx_web_server_container | ||
image: nginx:latest | ||
volumes: | ||
- type: bind | ||
source: nginx/nginx.prod.conf | ||
target: /etc/nginx/nginx.conf | ||
ports: | ||
- "80:80" | ||
restart: always | ||
|
||
volumes: | ||
db_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Use an official Python runtime as a parent image, Alpine version for a lighter footprint | ||
FROM python:3.12-alpine | ||
|
||
# Install MySQL client and temporary build dependencies | ||
RUN apk add --no-cache mysql-client \ | ||
&& apk add --no-cache --virtual .build-deps gcc musl-dev python3-dev libffi-dev openssl-dev | ||
|
||
# Set the working directory in the container to /app | ||
WORKDIR /app | ||
|
||
# Copy files | ||
COPY app/ ./app | ||
COPY core/ ./core | ||
COPY migrations/ ./migrations | ||
|
||
# Copy requirements.txt into the working directory /app | ||
COPY requirements.txt . | ||
|
||
# Copy the wait-for-db.sh script and set execution permissions | ||
COPY --chmod=+x scripts/wait-for-db.sh ./scripts/ | ||
|
||
# Install any needed packages specified in requirements.txt and upgrade pip | ||
RUN pip install --no-cache-dir -r requirements.txt \ | ||
&& pip install --no-cache-dir --upgrade pip \ | ||
&& apk del .build-deps | ||
|
||
|
||
# Expose port 5000 | ||
EXPOSE 5000 |