mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Add more instructions for running in Docker
This commit is contained in:
parent
5226f9ff4e
commit
d2763d2761
|
|
@ -39,4 +39,9 @@ WORKDIR /app
|
||||||
RUN bunx prisma generate
|
RUN bunx prisma generate
|
||||||
# CD to app
|
# CD to app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENTRYPOINT [ "bun", "run", "index.ts" ]
|
ENTRYPOINT [
|
||||||
|
# Run migrations and start the server
|
||||||
|
"bun", "migrate",
|
||||||
|
"&&", "bunx", "prisma", "generate",
|
||||||
|
"&&", "bun", "run", "index.ts"
|
||||||
|
]
|
||||||
|
|
|
||||||
35
README.md
35
README.md
|
|
@ -110,17 +110,40 @@ You can use the `help` command to see a list of available commands. These includ
|
||||||
|
|
||||||
## With Docker
|
## With Docker
|
||||||
|
|
||||||
> **Note**: Docker would probably work perfectly fine, but it has not been tested, and as such there are no instructions for its usage with Lysand.
|
> **Note**: Docker is currently broken, as Bun with Prisma does not work well with Docker yet for unknown reasons. The following instructions are for when this is fixed.
|
||||||
|
>
|
||||||
|
> These instructions will probably also work with Podman and other container runtimes.
|
||||||
|
|
||||||
You can also run Lysand using Docker. To do so, you will need to build the Docker image:
|
You can also run Lysand using Docker. To do so, you can:
|
||||||
|
|
||||||
|
1. Acquire the Postgres Dockerfile from above
|
||||||
|
2. Use this repository's [`docker-compose.yml`](docker-compose.yml) file
|
||||||
|
3. Create the `lysand-net` docker network:
|
||||||
```bash
|
```bash
|
||||||
# After cloning the repository
|
docker network create lysand-net
|
||||||
cd lysand
|
```
|
||||||
sudo docker compose build
|
4. Run the following command:
|
||||||
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
The Docker build isn't ready for usage, so you will need to do things like running migrations and setting up the database manually.
|
You may need root privileges to run Docker commands.
|
||||||
|
|
||||||
|
### Running CLI commands inside Docker
|
||||||
|
|
||||||
|
You can run CLI commands inside Docker using the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec -it lysand bun cli ...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running migrations inside Docker
|
||||||
|
|
||||||
|
You can run migrations inside Docker using the following command (if needed):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec -it lysand bun migrate
|
||||||
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,40 @@
|
||||||
version: '3'
|
---
|
||||||
|
# Run `docker network create lysand-net` before running docker-compose up
|
||||||
|
version: "3"
|
||||||
services:
|
services:
|
||||||
lysand:
|
lysand:
|
||||||
build:
|
image: ghcr.io/lysand-org/lysand:main
|
||||||
context: .
|
volumes:
|
||||||
dockerfile: Dockerfile
|
#- ./logs:/app/logs
|
||||||
ports:
|
- ./config:/app/config
|
||||||
- 8080:8080
|
- ./.env:/app/.env
|
||||||
container_name: lysand
|
restart: unless-stopped
|
||||||
volumes:
|
container_name: lysand
|
||||||
- ./logs:/app/logs
|
networks:
|
||||||
- ./config:/app/config
|
- lysand-net
|
||||||
|
db:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Postgres.Dockerfile
|
||||||
|
container_name: lysand-db
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: lysand
|
||||||
|
POSTGRES_USER: lysand
|
||||||
|
POSTGRES_PASSWORD: lysand
|
||||||
|
networks:
|
||||||
|
- lysand-net
|
||||||
|
volumes:
|
||||||
|
- ./db-data:/var/lib/postgresql/data
|
||||||
|
redis:
|
||||||
|
image: "redis:latest"
|
||||||
|
container_name: lysand-redis
|
||||||
|
volumes:
|
||||||
|
- ./redis-data:/data
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- lysand-net
|
||||||
|
|
||||||
|
networks:
|
||||||
|
lysand-net:
|
||||||
|
external: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue