-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (47 loc) · 1.56 KB
/
docker-compose.yml
File metadata and controls
51 lines (47 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# defines the containers that will be run
services:
# service name
nextjs-service:
# service image
image: 072216710152.dkr.ecr.sa-east-1.amazonaws.com/peso-repo:nextjs-latest
container_name: nextjs_app
restart: always
env_file:
- .env.production
environment:
- NODE_ENV=production
# exposes port only for other services declared in the docker-compose
expose:
- "3000"
networks:
- peso_network
# service name
nginx:
image: 072216710152.dkr.ecr.sa-east-1.amazonaws.com/peso-repo:nginx-latest
container_name: nginx_proxy
# if the container crashes, docker will always restart it
restart: always
ports:
# maps port 80 on your host to 80 on the container
- "80:80"
- "443:443"
volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
# ensures that the next.js service is started before nginx
depends_on:
- nextjs-service
networks:
- peso_network
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
# entrypoint: "/bin/sh -c 'certbot certonly --webroot --webroot-path=/var/www/certbot --email john@email.com --agree-tos --no-eff-email -d pesodevops.com -d www.pesodevops.com'"
# allows containers to exchange data by name using a shared virtual network
# this means containers communicate using DNS-based names (like nextjs-service) instead of IPs
networks:
peso_network: