Skip to content

Commit

Permalink
add tocker-compose examples
Browse files Browse the repository at this point in the history
  • Loading branch information
giocomai authored Apr 26, 2023
1 parent e4aa79b commit fa730ea
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docker-compose_local_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "3.3"

services:

omekas:
depends_on:
- omekas_db
image: docker.io/giocomai/omeka-s-docker:v3.2.3.production
container_name: omekas
ports:
- "8000:80"
restart: always
volumes:
- omekas:/var/www/html/volume:Z
networks:
static-network:
ipv4_address: 172.20.0.1

omekas_db:
image: docker.io/library/mysql:5.7
container_name: omekas_db
restart: always
volumes:
- omeka_db:/var/lib/mysql:Z
environment:
MYSQL_ROOT_PASSWORD: secretpassword #FIXME
MYSQL_DATABASE: secretstring #FIXME
MYSQL_USER: secretstring #FIXME
MYSQL_PASSWORD: secretpassword #FIXME
networks:
static-network:
ipv4_address: 172.20.0.2


volumes:
omeka_db:
omekas:
networks:
static-network:
ipam:
config:
- subnet: 172.20.0.0/16
#docker-compose v3+ do not use ip_range
ip_range: 172.28.5.0/24
78 changes: 78 additions & 0 deletions docker-compose_traefik_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
version: "3.3"

services:

traefik:
image: "traefik:v2.9"
container_name: "traefik"
restart: always
networks:
- network1
command:
#- "--log.level=DEBUG"
- "--api"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge=true"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web"
#- "--certificatesresolvers.myhttpchallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myhttpchallenge.acme.email=example@example.org" #FIXME
- "--certificatesresolvers.myhttpchallenge.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
labels:
- "traefik.enable=true"
# global redirect to https
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirs.entrypoints=web"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

omekas_db:
image: mysql:5.7
container_name: omekas_db
restart: always
networks:
- network1
volumes:
- omekas_db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: secretpassword #FIXME
MYSQL_DATABASE: secretstring #FIXME
MYSQL_USER: secretstring #FIXME
MYSQL_PASSWORD: secretpassword #FIXME

omekas:
depends_on:
- omekas_db
image: giocomai/omeka-s-docker:v3.2.3.production
container_name: omekas
restart: always
networks:
- network1
links:
- omekas_db:omekas_db
volumes:
- omekas:/var/www/html/volume:Z
labels:
- "traefik.enable=true"
- "traefik.http.routers.omekas.rule=Host(`example.com`)" #FIXME
- "traefik.http.routers.omekas.entrypoints=websecure"
- "traefik.http.routers.omekas.tls.certresolver=myhttpchallenge"
- "traefik.docker.network=network1"

volumes:
omekas_db:
omekas:

networks:
network1:
external: true

0 comments on commit fa730ea

Please sign in to comment.