chore: update parcels ports
e7d2f60d
5 file(s) · +11 −6
| 2 | 2 | DATABASE_URL=sqlite://parcels.db |
|
| 3 | 3 | USPS_CLIENT_ID=your_client_id_here |
|
| 4 | 4 | USPS_CLIENT_SECRET=your_client_secret_here |
|
| 5 | - | BIND_ADDR=0.0.0.0:3000 |
|
| 5 | + | PORT=3000 |
|
| 6 | 6 | COOKIE_SECURE=false |
| 35 | 35 | COPY --from=builder /app/target/release/parcels ./parcels |
|
| 36 | 36 | COPY --from=builder /app/apps/parcels/static ./static |
|
| 37 | 37 | COPY --from=builder /app/apps/parcels/templates ./templates |
|
| 38 | - | EXPOSE 3012 |
|
| 38 | + | EXPOSE 3000 |
|
| 39 | 39 | CMD ["./parcels"] |
| 28 | 28 | | `DATABASE_URL` | SQLite database path (e.g. `sqlite:///app/data/parcels.db`) | |
|
| 29 | 29 | | `USPS_CLIENT_ID` | USPS OAuth2 client ID | *required* | |
|
| 30 | 30 | | `USPS_CLIENT_SECRET` | USPS OAuth2 client secret | *required* | |
|
| 31 | - | | `BIND_ADDR` | Server bind address | `0.0.0.0:3012` | |
|
| 31 | + | | `PORT` | Server port | `3000` | |
|
| 32 | 32 | | `COOKIE_SECURE` | Enable HTTPS-only cookies | `false` | |
|
| 33 | 33 | ||
| 34 | 34 | ## Overview |
|
| 72 | 72 | docker compose up -d |
|
| 73 | 73 | ``` |
|
| 74 | 74 | ||
| 75 | - | This will start Parcels on port `3012` with a persistent volume for the SQLite database. |
|
| 75 | + | This will start Parcels on port `3000` with a persistent volume for the SQLite database. |
|
| 76 | 76 | ||
| 77 | 77 | ### Binary |
|
| 78 | 78 | ||
| 4 | 4 | context: ../.. |
|
| 5 | 5 | dockerfile: apps/parcels/Dockerfile |
|
| 6 | 6 | ports: |
|
| 7 | - | - "3012:3012" |
|
| 7 | + | - "3000:3000" |
|
| 8 | 8 | volumes: |
|
| 9 | 9 | - parcels_data:/app/data |
|
| 10 | 10 | env_file: |
| 349 | 349 | let app_password = env::var("APP_PASSWORD").expect("APP_PASSWORD must be set"); |
|
| 350 | 350 | let usps_client_id = env::var("USPS_CLIENT_ID").expect("USPS_CLIENT_ID must be set"); |
|
| 351 | 351 | let usps_client_secret = env::var("USPS_CLIENT_SECRET").expect("USPS_CLIENT_SECRET must be set"); |
|
| 352 | - | let bind_addr = env::var("BIND_ADDR").unwrap_or_else(|_| "0.0.0.0:3012".to_string()); |
|
| 352 | + | let host = env::var("HOST").unwrap_or_else(|_| "0.0.0.0".to_string()); |
|
| 353 | + | let port: u16 = env::var("PORT") |
|
| 354 | + | .ok() |
|
| 355 | + | .and_then(|v| v.parse().ok()) |
|
| 356 | + | .unwrap_or(3000); |
|
| 357 | + | let bind_addr = format!("{}:{}", host, port); |
|
| 353 | 358 | let cookie_secure = env::var("COOKIE_SECURE") |
|
| 354 | 359 | .map(|v| v.eq_ignore_ascii_case("true")) |
|
| 355 | 360 | .unwrap_or(false); |