Skip to content
Open
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ Responsible for building new subscribie sites.
- Each site runs as a uwsgi 'vassal' which allows new sites to come online
without having to restart the web server

# Local development using `podman-compose`

1. [Install `podman`](https://podman.io/getting-started/installation)
2. Install `podman-compose`:
```
python3 -m venv venv;
. venv/bin/activate
pip install podman-compose
```

Start `subscribie-deployer` & `subscribie-server`

```
./run.sh
```

`subscribie-server` is responsible for hosting shops.

## Configuration

#### Create virtual env & install requirements:
Expand Down
18 changes: 18 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
subscribie-deployer:
image: subscribie/deployer
build:
context: ./src/subscribie-deployer
ports:
- "5001:5001"
# https://github.com/compose-spec/compose-spec/blob/master/spec.md#volumes
volumes:
- type: bind
source: ./src/subscribie-deployer
target: /usr/src/app
subscribie-server:
image: subscribie/subscribie-server
build:
context: ./src/subscribie-server
ports:
- "8080:80"
7 changes: 6 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
uvicorn --reload main:app --host 0.0.0.0 --port 5001
#!/bin/bash

set -euxo pipefail

podman-compose up --build --force-recreate
#docker-compose -f compose.yaml up --build --force-recreate
8 changes: 8 additions & 0 deletions src/subscribie-deployer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.10.7
ENV PYTHONUNBUFFERED=1

WORKDIR /usr/src/app
COPY . .
RUN pip install -r requirements.txt

CMD uvicorn --reload main:app --host 0.0.0.0 --port 5001
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions src/subscribie-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM httpd

WORKDIR /usr/src/app

COPY . .

RUN apt-get update && apt-get install -y python3 python3-pip

RUN pip install -r requirements.txt

# Enable httpd mod_proxy_uwsgi
RUN sed -i \
-e 's/^#\(LoadModule .*mod_proxy_uwsgi.so\)/\1/' \
conf/httpd.conf

1 change: 1 addition & 0 deletions src/subscribie-server/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uWSGI==2.0.20