mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-16 03:47:56 +01:00
Small Docker fixes & features (#68)
* Fix permission error creating a file/folder in the upload folder * Fix first startup. Add postgress healthcheck and make it a required dpendency for the start of the app container * Add to easy test new features and build a local Docker image
This commit is contained in:
@@ -99,7 +99,7 @@ RUN mkdir /home/nobody && chown nobody /home/nobody
|
||||
|
||||
WORKDIR "/app"
|
||||
RUN mkdir /app/uploads
|
||||
RUN chown nobody /app
|
||||
RUN chown -R nobody /app
|
||||
|
||||
# Only copy the final release from the build stage
|
||||
COPY --from=builder --chown=nobody:root /app/_build/prod/rel/claper ./
|
||||
|
||||
14
README.md
14
README.md
@@ -113,9 +113,21 @@ A Docker Compose [reference file](https://github.com/ClaperCo/Claper/blob/main/d
|
||||
```sh
|
||||
git clone https://github.com/ClaperCo/Claper.git
|
||||
cd Claper
|
||||
docker-compose up
|
||||
docker compose up
|
||||
```
|
||||
|
||||
|
||||
### Using Docker Compose for Dev
|
||||
|
||||
To easy check new features, it is possible to directly build the Docker image from the source code and run the container with the [docker-compose-dev.yml](https://github.com/ClaperCo/Claper/blob/main/docker-compose-dev.yml) file.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/ClaperCo/Claper.git
|
||||
cd Claper
|
||||
docker compose -f docker-compose-dev.yml up
|
||||
```
|
||||
|
||||
|
||||
<!-- CONTRIBUTING -->
|
||||
## Contributing
|
||||
|
||||
|
||||
37
docker-compose-dev.yml
Normal file
37
docker-compose-dev.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
version: "3.0"
|
||||
services:
|
||||
db:
|
||||
image: postgres:9
|
||||
ports:
|
||||
- 5432:5432
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_PASSWORD: claper
|
||||
POSTGRES_USER: claper
|
||||
POSTGRES_DB: claper
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U claper"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- 4000:4000
|
||||
volumes:
|
||||
- uploads:/app/uploads
|
||||
environment:
|
||||
DATABASE_URL: postgres://claper:claper@db:5432/claper
|
||||
SECRET_KEY_BASE: 0LZiQBLw4WvqPlz4cz8RsHJlxNiSqM9B48y4ChyJ5v1oA0L/TPIqRjQNdPZN3iEG
|
||||
MAIL_TRANSPORT: local
|
||||
ENDPOINT_PORT: 4000
|
||||
PRESENTATION_STORAGE: local
|
||||
MAX_FILE_SIZE_MB: 15
|
||||
ENABLE_ACCOUNT_CREATION: true
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
postgres-data:
|
||||
uploads:
|
||||
@@ -10,6 +10,11 @@ services:
|
||||
POSTGRES_PASSWORD: claper
|
||||
POSTGRES_USER: claper
|
||||
POSTGRES_DB: claper
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U claper"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
app:
|
||||
image: ghcr.io/claperco/claper:latest
|
||||
ports:
|
||||
@@ -25,6 +30,7 @@ services:
|
||||
MAX_FILE_SIZE_MB: 15
|
||||
ENABLE_ACCOUNT_CREATION: true
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
uploads:
|
||||
Reference in New Issue
Block a user