Skip to content

Commit

Permalink
Break up Docker Compose files into dev and production versions
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMajeri committed Jan 24, 2025
1 parent 3de3e32 commit 5627f37
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 64 deletions.
75 changes: 75 additions & 0 deletions compose.production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
services:
# Container for web app
web:
build: .
depends_on:
- postgres
- nginx-proxy-acme
restart: unless-stopped
networks:
- nginx-proxy
- database
environment:
DATABASE_URL: postgresql://taxes_app:dev_pwd@postgres:5432/taxes?schema=public
VIRTUAL_HOST: ponou.unibuc.ro
LETSENCRYPT_HOST: ponou.unibuc.ro

# Container for NGINX reverse proxy
nginx-proxy:
image: nginxproxy/nginx-proxy:latest
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- nginx-proxy
labels:
- com.github.nginx-proxy.nginx
environment:
TRUST_DOWNSTREAM_PROXY: false

# ACME companion for NGINX, for automatical TLS certificate generation
nginx-proxy-acme:
image: nginxproxy/acme-companion:latest
restart: unless-stopped
depends_on:
- nginx-proxy
volumes:
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
- /etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- nginx-proxy
environment:
DEFAULT_EMAIL: [email protected]

# Database container
postgres:
image: postgres:16.1
expose:
- 5432
environment:
POSTGRES_USER: taxes_app
POSTGRES_PASSWORD: dev_pwd
POSTGRES_DB: taxes
volumes:
- db-data:/var/lib/postgresql/data
networks:
- database

volumes:
nginx-certs:
nginx-vhost:
nginx-html:
db-data:

networks:
nginx-proxy:
database:
65 changes: 2 additions & 63 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,14 @@
services:
# Container for web app
web:
build: .
depends_on:
- postgres
- nginx-proxy-acme
restart: unless-stopped
networks:
- nginx-proxy
- database
environment:
DATABASE_URL: postgresql://taxes_app:dev_pwd@postgres:5432/taxes?schema=public
VIRTUAL_HOST: ponou.unibuc.ro
LETSENCRYPT_HOST: ponou.unibuc.ro

# Container for NGINX reverse proxy
nginx-proxy:
image: nginxproxy/nginx-proxy:latest
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- nginx-proxy
labels:
- com.github.nginx-proxy.nginx
environment:
TRUST_DOWNSTREAM_PROXY: false

# ACME companion for NGINX, for automatical TLS certiifcate generation
nginx-proxy-acme:
image: nginxproxy/acme-companion:latest
restart: unless-stopped
depends_on:
- nginx-proxy
volumes:
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
- /etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- nginx-proxy
environment:
DEFAULT_EMAIL: [email protected]

# Database container
postgres:
image: postgres:16.1
expose:
- 5432
ports:
- 5432:5432
environment:
POSTGRES_USER: taxes_app
POSTGRES_PASSWORD: dev_pwd
POSTGRES_DB: taxes
volumes:
- db-data:/var/lib/postgresql/data
networks:
- database

volumes:
nginx-certs:
nginx-vhost:
nginx-html:
db-data:

networks:
nginx-proxy:
database:
5 changes: 4 additions & 1 deletion src/app/admin/auth/sign-in/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { Suspense } from "react";
import SignInButton from "./SignInButton";

export default async function SignInPage() {
return (
<div>
<SignInButton />
<Suspense>
<SignInButton />
</Suspense>
</div>
);
}

0 comments on commit 5627f37

Please sign in to comment.