-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker development setup with remote debugging
- Loading branch information
Showing
7 changed files
with
131 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/dumb-init /bin/sh | ||
|
||
# Integrate environment variables | ||
sed -i "s|__BACKEND__|${BACKEND_HOST}|" \ | ||
/etc/nginx/nginx.conf | ||
|
||
# Start server | ||
nginx& | ||
|
||
# Watch source for changes and build app | ||
npm run watch -- --polling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
version: "2" | ||
|
||
services: | ||
server: | ||
build: | ||
context: ./server | ||
target: development | ||
depends_on: | ||
- sql | ||
environment: | ||
## These should be the names of the dependent containers listed below, | ||
## or FQDNs/IP addresses if these services are running outside of Docker | ||
POSTGRES_HOST: sql | ||
## Credentials for database: | ||
POSTGRES_USER: | ||
POSTGRES_PASSWORD: ## Commented Values are Default: | ||
|
||
#POSTGRES_DB: defaults to same as POSTGRES_USER | ||
#POSTGRES_PORT: 5432 | ||
#LOG_SQL: 0 (1 for verbose SQL logs) | ||
DEBUG: 1 | ||
WAIT_FOR_CLIENT: 0 | ||
volumes: | ||
- "data:/data" | ||
- "./server/:/opt/app/" | ||
ports: | ||
- "5678:5678" | ||
|
||
client: | ||
build: | ||
context: ./client | ||
target: development | ||
depends_on: | ||
- server | ||
environment: | ||
BACKEND_HOST: server | ||
BASE_URL: | ||
volumes: | ||
- "data:/data:ro" | ||
- "./client/:/opt/app/" | ||
- "/opt/app/public/" | ||
ports: | ||
- "${PORT}:80" | ||
# Port 8081 is used for the live-reload when the source code is changed. | ||
- "8081:8081" | ||
|
||
sql: | ||
image: postgres:11-alpine | ||
restart: unless-stopped | ||
environment: | ||
POSTGRES_USER: | ||
POSTGRES_PASSWORD: | ||
volumes: | ||
- "sql:/var/lib/postgresql/data" | ||
|
||
volumes: | ||
data: | ||
sql: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/dumb-init /bin/sh | ||
set -e | ||
cd /opt/app | ||
|
||
alembic upgrade head | ||
|
||
echo "Starting szurubooru API on port ${PORT}" | ||
exec hupper -m waitress --port ${PORT} szurubooru.facade:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters