@@ -17,6 +17,10 @@ The application uses a multi-service Docker architecture:
1717git clone https://github.com/dunamismax/go-web-server.git
1818cd go-web-server
1919
20+ # Create your environment file
21+ cp .env.example .env
22+ # Edit .env with your database credentials (DATABASE_USER, DATABASE_PASSWORD, etc.)
23+
2024# Start all services
2125docker compose up --build
2226
@@ -31,7 +35,7 @@ open http://localhost:8080 # Direct application access
3135
3236- ** Image** : ` postgres:16-alpine `
3337- ** Port** : 5432 (exposed in development)
34- - ** Credentials** : user/password (change in production)
38+ - ** Credentials** : Configured via .env file environment variables
3539- ** Volume** : ` postgres_data ` for data persistence
3640- ** Migrations** : Auto-applied on container startup
3741
@@ -102,6 +106,10 @@ docker compose --env-file .env.production up -d
102106### Local Development
103107
104108``` bash
109+ # Create your environment file
110+ cp .env.example .env
111+ # Edit .env with your database credentials
112+
105113# Start database only
106114docker compose up postgres -d
107115
@@ -202,6 +210,7 @@ docker network inspect gowebserver-network
202210### Common Issues
203211
204212** Application won't start:**
213+
205214``` bash
206215# Check dependencies
207216docker compose ps
@@ -212,6 +221,7 @@ docker exec gowebserver-postgres pg_isready -U user
212221```
213222
214223** Caddy SSL issues:**
224+
215225``` bash
216226# Check domain DNS
217227nslookup yourdomain.com
@@ -224,6 +234,7 @@ curl -I http://yourdomain.com
224234```
225235
226236** Database connection issues:**
237+
227238``` bash
228239# Check PostgreSQL logs
229240docker compose logs postgres
@@ -235,6 +246,7 @@ docker exec -it gowebserver-postgres psql -U user -d gowebserver -c "SELECT 1;"
235246### Performance Optimization
236247
237248** Database tuning in docker-compose.yml:**
249+
238250``` yaml
239251postgres :
240252 environment :
@@ -244,6 +256,7 @@ postgres:
244256` ` `
245257
246258**Application scaling:**
259+
247260` ` ` bash
248261docker compose up -d --scale app=3
249262```
@@ -330,4 +343,4 @@ gunzip -c backup_20240101_120000.sql.gz | docker exec -i gowebserver-postgres ps
330343docker compose up -d app caddy
331344```
332345
333- This Docker-first architecture provides a robust, scalable, and secure foundation for deploying the Go Web Server in any environment.
346+ This Docker-first architecture provides a robust, scalable, and secure foundation for deploying the Go Web Server in any environment.
0 commit comments