feat: docker

docs: docker deployment
chore: gitignore
This commit is contained in:
httpjamesm 2022-12-28 00:27:37 -05:00
parent fd6ca8b56a
commit 0a525248ac
4 changed files with 44 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
docker-compose.yml

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM golang:1.18-alpine
RUN apk add musl-dev
RUN apk add libc-dev
RUN apk add gcc
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY ./ /app
RUN go build -o /anonymousoverflow
EXPOSE 8080
CMD ["/anonymousoverflow"]

View File

@ -33,3 +33,13 @@ becomes
```
${instanceURL}/questions/43743250/using-libsodium-xchacha20-poly1305-for-large-files
```
## How to deploy
AnonymousOverflow uses Docker for deployment.
Install Docker for your platform and copy the `docker-compose.example.yml` file to `docker-compose.yml`.
Then, tweak settings if needed.
Run `docker compose up -d` to build and start the container.

View File

@ -0,0 +1,11 @@
version: '3'
services:
anonymousoverflow:
container_name: 'app'
build:
context: .
network: 'host'
ports:
- '80:8080'
restart: 'always'