Added traefik config
This commit is contained in:
parent
926a6d7bc1
commit
09aaff878a
38
docker-compose.server.yml
Normal file
38
docker-compose.server.yml
Normal file
@ -0,0 +1,38 @@
|
||||
services:
|
||||
app:
|
||||
image: app:latest
|
||||
build:
|
||||
context: docker
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
- ./docker/nginx/default.conf:/etc/nginx/sites-enabled/
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.calendi.entrypoints=web"
|
||||
- "traefik.http.routers.calendi.rule=Host(`calendi.strolap.com`)"
|
||||
- "traefik.http.routers.calendi.tls=true"
|
||||
- "traefik.http.routers.calendi.certresolver=strolap"
|
||||
- "traefik.http.services.calendi.loadbalancer.server.port=80"
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
postgres:
|
||||
image: postgres:15
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./var/postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
@ -4,11 +4,16 @@ services:
|
||||
build:
|
||||
context: docker
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "9010:80"
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
- ./docker/nginx/default.conf:/etc/nginx/sites-enabled/default
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.app.entrypoints=web"
|
||||
- "traefik.http.routers.app.rule=Host(`calendi.test`)"
|
||||
- "traefik.http.services.app.loadbalancer.server.port=80"
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
postgres:
|
||||
image: postgres:15
|
||||
@ -20,6 +25,12 @@ services:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./var/postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM debian:latest
|
||||
FROM debian:latest AS builder
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
@ -55,5 +55,19 @@ WORKDIR /var/www/html
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
FROM debian:latest AS dev
|
||||
|
||||
# Set entrypoint
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
FROM debian:latest AS prod
|
||||
|
||||
COPY . /var/www/html
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
RUN cd backend && composer install --optimize-autoloader --no-dev
|
||||
RUN cd frontend && npm install && npm run build
|
||||
|
||||
# Set entrypoint
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user