Skip to content

Commit

Permalink
prod dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zediious committed Oct 31, 2023
1 parent 5d17a2e commit 60d69dc
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
name: Build and push
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile
file: Dockerfile-prod
push: true
tags: zediious/raptor-web:latest
8 changes: 6 additions & 2 deletions docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Dockerfile for raptorapp
# Dockerfile for raptor-web development
# This image does NOT build the app's code into the image.
# It instead relies on paths to local files in docker-compose.yml
# Use docker-compose-prod.yml for production.

FROM continuumio/miniconda3:latest

# Install host dependencies
Expand All @@ -7,7 +11,7 @@ RUN apt install libmariadb-dev -y
RUN apt install gcc -y

# Copy Conda environment and install environment
COPY ../environment.yml environment.yml
COPY environment.yml environment.yml
RUN conda env create

# Add initialization script and define entrypoint
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Dockerfile for raptorapp
FROM continuumio/miniconda3:latest

# Install host dependencies
RUN apt update
RUN apt install libmariadb-dev -y
RUN apt install gcc -y

# Copy project files and install environment
COPY . /raptorWebApp
RUN conda env create -f /raptorWebApp/environment.yml

# Define entrypoint
RUN chmod +x+r -R /raptorWebApp/docker/init
ENTRYPOINT ["/raptorWebApp/docker/init/run-raptorapp.sh"]
40 changes: 40 additions & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '3'
services:

mariadb:
image: mariadb:latest
container_name: mariadb
expose:
- 3306
env_file:
- stack.env
volumes:
- raptor-db:/var/lib/mysql/

raptorapp:
image: zediious/raptor-web:latest
container_name: raptorapp
expose:
- 80
volumes:
- raptor-media:/raptorWebApp/media/
- raptor-conf:/raptorWebApp//docker/nginx/conf.d/
- ./stack.env:/raptorWebApp/stack.env
depends_on:
- mariadb

nginx:
image: nginx:latest
container_name: nginx
ports:
- 443:443
volumes:
- raptor-media:/raptorWeb/media:/raptor_app/media/
- raptor-conf:/etc/nginx/conf.d/
depends_on:
- raptorapp

volumes:
raptor-db:
raptor-media:
raptor-conf:
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Compose file for raptor-web development
# This re-builds the application image on load.
# Use docker-compose-prod.yml for production.

version: '3'
services:

Expand All @@ -14,7 +18,7 @@ services:
raptorapp:
build:
context: .
dockerfile: docker/Dockerfile
dockerfile: Dockerfile
container_name: raptorapp
expose:
- 80
Expand Down

0 comments on commit 60d69dc

Please sign in to comment.