chore: add example local setup

This commit is contained in:
Karol Sójko
2023-02-07 14:12:29 +01:00
parent b0e31ff305
commit d0c44d1376
5 changed files with 66 additions and 16 deletions

View File

@@ -1,14 +1,3 @@
###########
# General #
###########
EXPOSED_PORT=3000
#########
# FILES #
#########
EXPOSED_FILES_SERVER_PORT=3042
PUBLIC_FILES_SERVER_URL=http://localhost:3042
######
# DB #
######

View File

@@ -50,9 +50,6 @@ jobs:
- name: Run Server
run: docker compose -f docker-compose.ci.yml up -d
env:
EXPOSED_PORT: 3123
EXPOSED_FILES_SERVER_PORT: 3125
- name: Wait for server to start
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs

2
.gitignore vendored
View File

@@ -23,3 +23,5 @@ data/*
logs/*
!logs/.gitkeep
docker-compose.yml

View File

@@ -4,8 +4,8 @@ services:
env_file: .github/ci.env
container_name: server-ci
ports:
- ${EXPOSED_PORT}:3000
- ${EXPOSED_FILES_SERVER_PORT}:3104
- 3123:3000
- 3125:3104
volumes:
- ./logs:/var/lib/server/logs
networks:

View File

@@ -0,0 +1,62 @@
services:
server:
image: standardnotes/server
env_file: .env.sample
container_name: server-self-hosted
ports:
- 3000:3000
- 3125:3104
volumes:
- ./logs:/var/lib/server/logs
networks:
- standardnotes_self_hosted
localstack:
image: localstack/localstack:1.3
container_name: localstack-self-hosted
expose:
- 4566
restart: unless-stopped
environment:
- SERVICES=sns,sqs
- DOCKER_HOST=unix:///var/run/docker.sock
- HOSTNAME_EXTERNAL=localstack
- LS_LOG=warn
volumes:
- ./docker/localstack_bootstrap.sh:/etc/localstack/init/ready.d/localstack_bootstrap.sh
- /var/run/docker.sock:/var/run/docker.sock
networks:
- standardnotes_self_hosted
db:
image: mysql:8
container_name: db-self-hosted
environment:
- MYSQL_DATABASE=standard_notes_db
- MYSQL_USER=std_notes_user
- MYSQL_ROOT_PASSWORD=changeme123
- MYSQL_PASSWORD=changeme123
expose:
- 3306
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
volumes:
- ./data/mysql:/var/lib/mysql
- ./data/import:/docker-entrypoint-initdb.d
networks:
- standardnotes_self_hosted
cache:
image: redis:6.0-alpine
container_name: cache-self-hosted
volumes:
- ./data/redis/:/data
expose:
- 6379
restart: unless-stopped
networks:
- standardnotes_self_hosted
networks:
standardnotes_self_hosted:
name: standardnotes_self_hosted