Skip to content

Commit bd59f91

Browse files
committed
WIP for production docker container
1 parent 983032c commit bd59f91

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

contrib/docker/DockerFile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM debian:stable
2+
3+
RUN apt-get update
4+
RUN apt-get upgrade -y
5+
6+
# we need this to make https://deb.oxen.io fetches work
7+
RUN apt-get install -y ca-certificates curl apt-utils ucf vim
8+
9+
# install the Oxen apt repository public signing key:
10+
RUN curl -so /etc/apt/trusted.gpg.d/oxen.gpg https://deb.oxen.io/pub.gpg
11+
12+
# there is no lsb-release package on the base debian build
13+
RUN echo "deb https://deb.oxen.io $(cat /etc/os-release | grep VERSION_CODENAME | cut -d "=" -f2) main" > /etc/apt/sources.list.d/oxen.list
14+
RUN cat /etc/apt/sources.list.d/oxen.list
15+
RUN apt-get update
16+
17+
RUN echo sogs-standalone session-pysogs/url-http string http://example.com | debconf-set-selections
18+
RUN apt-get install -y sogs-standalone
19+
20+
# just add an alias to the pysogs start command
21+
RUN echo '#!/bin/bash\n/usr/bin/uwsgi --ini /etc/sogs/uwsgi-standalone.ini' > /usr/bin/pysogs && \
22+
chmod +x /usr/bin/pysogs
23+
24+
EXPOSE 80

contrib/docker/Readme.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1+
# Docker for pysogs production
2+
3+
Build the docker container image with
4+
5+
```
6+
sudo docker build . -f contrib/docker/DockerFile -t pysogs-prod
7+
```
8+
9+
Create docker volumes so we can persist data, config and key from the container to the host between container restarts
10+
11+
```
12+
sudo docker volume create pysogs-data
13+
sudo docker volume create pysogs-config
14+
```
15+
16+
Start the container and mount the volumes with
17+
18+
```
19+
sudo docker run -i -p 8080:80 -v pysogs-data:/var/lib/session-open-group-server -v pysogs-config:/etc/sogs/ -v pysogs-config:/etc/sogs/ -t pysogs-prod:latest
20+
```
21+
122
# Docker for pysogs development
223

324
The file DockerFile.dev is specifically made for development if you are not running linux.
425
It lets you create a docker running linux and the pysogs in it even if you are running Macos or Windows.
526
It creates a docker container with the content of this git repository mounted.
627
Basically, whatever you edit in this repository will be represented on the docker container. So when you run the container, it will run your code.
728

8-
# Not for production use
9-
10-
This docker image is strictly for development use and not supported for production use.
29+
> **WARNING**: Not for production use. This docker image is strictly for development use and not supported for production use.
1130
1231
## Build the container image
1332

@@ -29,8 +48,9 @@ sudo docker build . -f contrib/docker/DockerFile.dev -t pysogs-dev
2948

3049
Before you can run the container you need to set the base config. You can do so by copying `sogs.ini.sample` to `sogs.ini` and replacing the line with base_url with `base_url = http://localhost`.
3150

32-
Next,
33-
You can run and attach to the container with
51+
> **WARNING**: Not for production use. This docker image is strictly for development use and not supported for production use.
52+
53+
Next, you can run and attach to the container with
3454

3555
```
3656
sudo docker run -i -p 8080:80 -v $PWD:/session-pysogs -t pysogs-dev:latest

0 commit comments

Comments
 (0)