Skip to content

Commit

Permalink
feat: Render deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed May 31, 2024
1 parent 13a1fa2 commit ecbf2a7
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docker/docker-compose.prod.render.yml
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:
29 changes: 29 additions & 0 deletions docker/images/Dockerfile.render
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

0 comments on commit ecbf2a7

Please sign in to comment.