Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dev/environment
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SESSION_SECRET="an insecure development secret"
BILLING_BACKEND=warehouse.subscriptions.services.MockStripeBillingService api_base=http://stripe:12111 api_version=2020-08-27 domain=localhost
# BILLING_BACKEND=warehouse.subscriptions.services.StripeBillingService api_version=2020-08-27 publishable_key=pk_test_123 secret_key=sk_test_123 webhook_key=whsec_123 domain=localhost

CAMO_URL={request.scheme}://{request.domain}:9000/
CAMO_URL={request.scheme}://camo.localhost/
CAMO_KEY=insecurecamokey

# Example of a Live Reload URL for remote development
Expand All @@ -37,9 +37,9 @@ HIBP_API_KEY="something-not-real"

DOCS_URL="https://pythonhosted.org/{project}/"

FILES_BACKEND=warehouse.packaging.services.LocalFileStorage path=/var/opt/warehouse/packages/ url=http://localhost:9001/packages/{path}
ARCHIVE_FILES_BACKEND=warehouse.packaging.services.LocalArchiveFileStorage path=/var/opt/warehouse/packages-archive/ url=http://localhost:9001/packages-archive/{path}
SIMPLE_BACKEND=warehouse.packaging.services.LocalSimpleStorage path=/var/opt/warehouse/simple/ url=http://localhost:9001/simple/{path}
FILES_BACKEND=warehouse.packaging.services.LocalFileStorage path=/var/opt/warehouse/packages/ url=http://files.localhost/packages/{path}
ARCHIVE_FILES_BACKEND=warehouse.packaging.services.LocalArchiveFileStorage path=/var/opt/warehouse/packages-archive/ url=http://files.localhost/packages-archive/{path}
SIMPLE_BACKEND=warehouse.packaging.services.LocalSimpleStorage path=/var/opt/warehouse/simple/ url=http://files.localhost/simple/{path}
DOCS_BACKEND=warehouse.packaging.services.LocalDocsStorage path=/var/opt/warehouse/docs/
SPONSORLOGOS_BACKEND=warehouse.admin.services.LocalSponsorLogoStorage path=/var/opt/warehouse/sponsorlogos/
ORIGIN_CACHE=warehouse.cache.origin.fastly.NullFastlyCache api_key=some_api_key service_id=some_service_id
Expand Down
37 changes: 30 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ volumes:
cachedata:

services:
traefik:
image: traefik:v3.6
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--entrypoints.web.address=:80"
ports:
- "${WEB_PORT:-80}:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock

db:
image: postgres:17.5
ports:
Expand Down Expand Up @@ -60,9 +73,12 @@ services:

camo:
image: pypa/warehouse-camo:2.0.0
command: "/bin/go-camo --listen=0.0.0.0:9000 --header 'Access-Control-Allow-Origin: http://localhost'"
ports:
- "9000:9000"
command: "/bin/go-camo --listen=0.0.0.0:9000 --header 'Access-Control-Allow-Origin: *'"
labels:
- "traefik.enable=true"
- "traefik.http.routers.camo.rule=Host(`camo.localhost`)"
- "traefik.http.routers.camo.entrypoints=web"
- "traefik.http.services.camo.loadbalancer.server.port=9000"
environment:
GOCAMO_HMAC: "insecurecamokey"
GOCAMO_MAXSIZE: 10000
Expand Down Expand Up @@ -111,8 +127,12 @@ services:
env_file: dev/environment
pull_policy: never
volumes: *base_volumes
ports:
- "${WEB_PORT:-80}:8000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=PathPrefix(`/`)"
- "traefik.http.routers.web.priority=1"
- "traefik.http.routers.web.entrypoints=web"
- "traefik.http.services.web.loadbalancer.server.port=8000"
depends_on:
db:
condition: service_healthy
Expand Down Expand Up @@ -149,8 +169,11 @@ services:
- sponsorlogos:/var/opt/warehouse/sponsorlogos
- simple:/var/opt/warehouse/simple
- rstuf-metadata:/var/opt/warehouse/tuf-metadata
ports:
- "9001:9001"
labels:
- "traefik.enable=true"
- "traefik.http.routers.files.rule=Host(`files.localhost`)"
- "traefik.http.routers.files.entrypoints=web"
- "traefik.http.services.files.loadbalancer.server.port=9001"

worker:
image: warehouse:docker-compose
Expand Down
10 changes: 5 additions & 5 deletions docs/dev/development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ TUF trust root for development, and creates the initial set of TUF metadata.
the TUF metadata repository:

* RSTUF API: http://localhost:8001
* TUF Metadata Repository: http://localhost:9001/tuf-metadata/
* TUF Metadata Repository: http://files.localhost/tuf-metadata/

### Resetting the development database

Expand All @@ -259,8 +259,8 @@ This command will fully reset the development database.

### Viewing Warehouse in a browser

At this point all the services are up, and web container is listening on port
80. It's accessible at http://localhost:80/.
At this point all the services are up, and Traefik is routing traffic on port
80. The web application is accessible at http://localhost/.

!!! note
If you are using `docker-machine` on an older version of macOS or
Expand All @@ -279,7 +279,7 @@ use that port instead.

### Logging in to Warehouse

You can log into warehouse at http://localhost:80/account/login/.
You can log into warehouse at http://localhost/account/login/.

There are 4 accounts ready for you to use:

Expand Down Expand Up @@ -406,7 +406,7 @@ access your developer environment, you'll:
make serve
```

View Warehouse in the browser at http://localhost:80/.
View Warehouse in the browser at http://localhost/.

### Debugging the webserver

Expand Down
2 changes: 1 addition & 1 deletion docs/dev/development/reviewing-patches.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ If you are testing Warehouse locally, you may want to use [twine](https://github
uploading a test package. First, checkout the branch you would like to test.
Then, start up the development environment (as described in
[Getting Started](getting-started.md)). Once you have the Warehouse site working on
`localhost:80`, you can upload a package to the version of Warehouse running
`localhost`, you can upload a package to the version of Warehouse running
in your development environment with Twine using the following command:

```shell
Expand Down
Loading