Skip to content

Commit 4e7341d

Browse files
authored
cleanup for new deployment infra (#676)
* remove a ton of unused/redundant code * fly.io deployment, disable pawndex and remove old configs * re-add pawndex resource * remove unused env values that are now secrets * move deploy back to only master branch * clean frontend a bit * update announcement and add fly.io config for frontend
1 parent 0041dac commit 4e7341d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+147
-2962
lines changed

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.github
2+
.task
3+
.vscode
4+
5+
data/
6+
docs.bleve/
7+
frontend/
8+
9+
*.exe
10+
.env

.github/workflows/deploy.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Fly Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
10+
11+
jobs:
12+
deploy:
13+
name: Deploy app
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: superfly/flyctl-actions/setup-flyctl@master
18+
- run: flyctl deploy --remote-only

Taskfile.yml

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ tasks:
1313
build:
1414
cmds:
1515
- go build -o server.exe -ldflags="-X 'github.com/openmultiplayer/web/server/src/version.Version={{.VERSION}}'" ./server/
16-
vars:
17-
VERSION:
18-
sh: git describe --always --dirty --tags
1916

2017
# Production deployment run - migrate DB first, then
2118
production:

docker-compose.dev.yml

-49
This file was deleted.

docker-compose.yml

+3-148
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,10 @@
11
version: "3"
2-
networks:
3-
default:
4-
name: gateway
5-
external: true
62

73
services:
8-
api:
9-
restart: always
10-
image: southclaws/openmp-web
11-
environment:
12-
DATABASE_URL: ${DATABASE_URL}
13-
DATABASE_URL_BS: ${DATABASE_URL_BS}
14-
DEV_LOGIN_SECRET: ${DEV_LOGIN_SECRET}
15-
PRODUCTION: "true"
16-
LOG_LEVEL: debug
17-
AMQP_ADDRESS: ${AMQP_ADDRESS}
18-
HASH_KEY: ${HASH_KEY}
19-
BLOCK_KEY: ${BLOCK_KEY}
20-
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
21-
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
22-
DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID}
23-
DISCORD_CLIENT_SECRET: ${DISCORD_CLIENT_SECRET}
24-
SENDGRID_API_KEY: ${SENDGRID_API_KEY}
25-
GITHUB_TOKEN: ${GITHUB_TOKEN}
26-
PACKAGES_DB: /data/packages.db
27-
ports:
28-
- 8000:8000
29-
volumes:
30-
- ${DATA_DIR}/openmp/backend:/data
31-
depends_on:
32-
- postgres
33-
labels:
34-
traefik.enable: "true"
35-
traefik.docker.network: gateway
36-
traefik.http.routers.omp_api.rule: Host(`api.open.mp`)
37-
traefik.http.routers.omp_api.entrypoints: https
38-
traefik.http.routers.omp_api.tls.certresolver: default
39-
com.centurylinklabs.watchtower.enable: "true"
40-
41-
frontend:
42-
restart: always
43-
image: southclaws/openmp-frontend
44-
ports:
45-
- 3000:3000
46-
labels:
47-
traefik.enable: "true"
48-
traefik.docker.network: gateway
49-
traefik.http.routers.omp_frontend.rule: Host(`open.mp`, `www.open.mp`)
50-
traefik.http.routers.omp_frontend.entrypoints: https
51-
traefik.http.routers.omp_frontend.tls.certresolver: default
52-
traefik.http.middlewares.omp_redirect.redirectregex.regex: "^https://www.open.mp/(.*)"
53-
traefik.http.middlewares.omp_redirect.redirectregex.replacement: "https://open.mp/$${1}"
54-
com.centurylinklabs.watchtower.enable: "true"
55-
564
postgres:
575
image: postgres:13
58-
restart: always
59-
ports:
60-
- "25432:5432"
616
environment:
62-
POSTGRES_USER: ${POSTGRES_USER}
63-
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
64-
volumes:
65-
- ${DATA_DIR}/openmp/postgres:/var/lib/postgresql/data
66-
67-
minio:
68-
image: minio/minio
69-
command: server /data --console-address ":9001"
70-
restart: always
71-
environment:
72-
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
73-
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
74-
ports:
75-
- 9001:9001
76-
volumes:
77-
- ${DATA_DIR}/openmp/minio:/data
78-
labels:
79-
traefik.enable: "true"
80-
traefik.docker.network: gateway
81-
traefik.http.routers.omp_index_minio.rule: Host(`assets.open.mp`)
82-
traefik.http.routers.omp_index_minio.entrypoints: https
83-
traefik.http.routers.omp_index_minio.tls.certresolver: default
84-
traefik.http.services.omp_index_minio.loadbalancer.server.port: "9000"
85-
86-
prometheus:
87-
image: prom/prometheus
88-
command:
89-
- --config.file=/etc/prometheus/prometheus.yml
90-
- --storage.tsdb.path=/prometheus
91-
- --storage.tsdb.retention.size=10GB
92-
- --web.console.libraries=/usr/share/prometheus/console_libraries
93-
- --web.console.templates=/usr/share/prometheus/consoles
94-
restart: always
95-
ports:
96-
- 9090:9090
97-
volumes:
98-
- ${DATA_DIR}/openmp/prometheus:/prometheus
99-
- ./prometheus.yml:/etc/prometheus/prometheus.yml
100-
labels:
101-
traefik.enable: "true"
102-
traefik.docker.network: gateway
103-
traefik.http.routers.omp_index_prom.rule: Host(`data.open.mp`)
104-
traefik.http.routers.omp_index_prom.entrypoints: https
105-
traefik.http.routers.omp_index_prom.tls.certresolver: default
106-
com.centurylinklabs.watchtower.enable: "true"
107-
108-
rabbit:
109-
image: rabbitmq
110-
restart: always
111-
ports:
112-
- 8001:5672
113-
- 8002:15672
114-
115-
pgadmin:
116-
image: dpage/pgadmin4
117-
restart: always
118-
environment:
119-
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
120-
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
121-
ports:
122-
- 25433:80
123-
volumes:
124-
- ${DATA_DIR:?required}/openmp/pgadmin:/var/lib/pgadmin/storage
125-
labels:
126-
traefik.enable: "true"
127-
traefik.docker.network: gateway
128-
traefik.http.routers.omp_index_pgadmin.rule: Host(`pgadmin.open.mp`)
129-
traefik.http.routers.omp_index_pgadmin.entrypoints: https
130-
traefik.http.routers.omp_index_pgadmin.tls.certresolver: default
131-
com.centurylinklabs.watchtower.enable: "true"
132-
133-
mybb:
134-
image: mybb/mybb:latest
135-
restart: always
136-
volumes:
137-
- ${DATA_DIR:?required}/openmp/mybb:/var/www/html:rw
138-
labels:
139-
- traefik.enable=false
140-
141-
nginx:
142-
image: nginx:mainline
143-
restart: always
7+
POSTGRES_USER: ${POSTGRES_USER:-default}
8+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-default}
1449
volumes:
145-
- ./nginx.conf:/etc/nginx/nginx.conf:ro
146-
- ${DATA_DIR:?required}/openmp/mybb:/var/www/html:ro
147-
labels:
148-
traefik.enable: "true"
149-
traefik.docker.network: gateway
150-
traefik.http.routers.openmp_bs.rule: Host(`burgershot.gg`) || Host(`www.burgershot.gg`)
151-
traefik.http.routers.openmp_bs.entrypoints: https
152-
traefik.http.routers.openmp_bs.tls.certresolver: default
153-
traefik.http.services.openmp_bs.loadbalancer.server.port: "80"
154-
traefik.http.middlewares.openmp_bs.redirectregex.regex: "^https://www.burgershot.gg/(.*)"
155-
traefik.http.middlewares.openmp_bs.redirectregex.replacement: "https://burgershot.gg/$${1}"
10+
- ./data/openmp/postgres:/var/lib/postgresql/data

emails/README.md

-15
This file was deleted.

0 commit comments

Comments
 (0)