Skip to content

Commit

Permalink
Add Docker Compose for development (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystof-k authored Sep 3, 2023
1 parent 082709e commit ea1f857
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
8 changes: 8 additions & 0 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
PUBLIC_URL=http://localhost:5201
VITE_PUBLIC_URL=${PUBLIC_URL}

DATABASE_USERNAME=volebnikalkulacka
DATABASE_PASSWORD=volebnikalkulacka
DATABASE_SERVER=localhost
DATABASE_PORT=26257
DATABASE_NAME=volebnikalkulacka
DATABASE_URL_BASE=postgresql://${DATABASE_USERNAME}:${DATABASE_PASSWORD}@${DATABASE_SERVER}:${DATABASE_PORT}
DATABASE_URL=${DATABASE_URL_BASE}/${DATABASE_NAME}

EMAIL_SERVER_HOST="localhost"
EMAIL_SERVER_PORT="1025"
EMAIL_SERVER_SECURE="false"
Expand Down
8 changes: 0 additions & 8 deletions frontend/.env.development.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
# PUBLIC_URL=http://localhost:3000
VITE_PUBLIC_URL=${PUBLIC_URL}

# DATABASE_USERNAME=john-doe
# DATABASE_PASSWORD=HUVAkcJHcpffDZuSuQLmwN
# DATABASE_SERVER=john-doe-development-5467.7tc.cockroachlabs.cloud
# DATABASE_PORT=26257
# DATABASE_NAME=defaultdb
# DATABASE_URL_BASE=postgresql://${DATABASE_USERNAME}:${DATABASE_PASSWORD}@${DATABASE_SERVER}:${DATABASE_PORT}
# DATABASE_URL=${DATABASE_URL_BASE}/${DATABASE_NAME}

# JWT_SECRET=3c9e5326e407ccbb02590e7e898c284d5657653d713e99d5a1f45fb3990742ec64323649b6b3ed8c32518fb2dd9b089b53ca53310edc82e453b4be7fea455e65
# JWT_EXPIRES_IN=7d
# OAUTH_CALLBACK_URL=http://localhost:3000
Expand Down
39 changes: 39 additions & 0 deletions frontend/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: volebni-kalkulacka
services:
cockroach:
image: cockroachdb/cockroach
environment:
COCKROACH_USER: volebnikalkulacka
COCKROACH_PASSWORD: volebnikalkulacka
COCKROACH_DATABASE: volebnikalkulacka
ports:
- 26257:26257
- 8080:8080
volumes:
- cockroach:/cockroach/cockroach-data
networks:
- roachnet
command: start-single-node --certs-dir /cockroach/cockroach-data/certs --http-addr=0.0.0.0:8080
healthcheck:
test: curl --insecure --silent --fail https://localhost:8080
interval: 5s
timeout: 5s
retries: 15
mailhog:
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
volumes:
- mailhog:/maildir
healthcheck:
test: wget --quiet --output-document=/dev/null http://localhost:8025
interval: 5s
timeout: 5s
retries: 15
volumes:
cockroach:
mailhog:
networks:
roachnet:
driver: bridge

1 comment on commit ea1f857

@vercel
Copy link

@vercel vercel bot commented on ea1f857 Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.