Skip to content

Commit

Permalink
Switched env var in compose-prod to fix certs.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanCummings committed Aug 30, 2024
1 parent 77d4937 commit e261e03
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ mc cp --recursive <path-to-data> srv/mast
To run the production container to start the postgres database, fastapi, and minio containers. This will also start an nginx proxy and make sure https is all setup

```bash
docker-compose --env-file dev/docker/.env.dev -f dev/docker/docker-compose.yml -f dev/docker/docker-compose-prod.yml up --build --force-recreate --remove-orphans -d
docker compose --env-file dev/docker/.env.dev -f dev/docker/docker-compose.yml -f dev/docker/docker-compose-prod.yml up --build --force-recreate --remove-orphans -d
```

To shut down the production deployment, run the following command:

```bash
docker-compose --env-file dev/docker/.env.dev -f dev/docker/docker-compose.yml -f dev/docker/docker-compose-prod.yml down
docker compose --env-file dev/docker/.env.dev -f dev/docker/docker-compose.yml -f dev/docker/docker-compose-prod.yml down
```

To also destory the volumes (including the metadatabase) you may add the volumes parameter:
```bash
docker-compose --env-file dev/docker/.env.dev -f dev/docker/docker-compose.yml -f dev/docker/docker-compose-prod.yml down --volumes
docker compose --env-file dev/docker/.env.dev -f dev/docker/docker-compose.yml -f dev/docker/docker-compose-prod.yml down --volumes
```

Note that every time you destory volumes, the production server will mint a new certificate for HTTPS. Lets Encrypt currently limits this to [5 per week](https://letsencrypt.org/docs/duplicate-certificate-limit/)
Expand Down
5 changes: 2 additions & 3 deletions dev/docker/api.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM python:3.11
WORKDIR /code

ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
RUN /install.sh && rm /install.sh
RUN pip install uv

COPY ./requirements.txt /code/requirements.txt

RUN /root/.cargo/bin/uv pip install --system --no-cache -r /code/requirements.txt
RUN uv pip install --system --no-cache -r /code/requirements.txt

COPY ./src /code/src

Expand Down
2 changes: 2 additions & 0 deletions dev/docker/docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ services:
- DATABASE_HOST=pg_container
- DATABASE_PORT=5432
- VIRTUAL_HOST=mastapp.site
#- VIRTUAL_HOST=130.246.215.157
- VIRTUAL_PORT=5000
- LETSENCRYPT_HOST=mastapp.site
#- LETSENCRYPT_HOST=130.246.215.157
networks:
- dbnetwork

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ xarray_datatree==0.0.12
zarr==2.15.0
httpx
pint
ujson

0 comments on commit e261e03

Please sign in to comment.