Hi first off all thank you for this tutorial.
I guess i'm missing one last step.
I did everything exactly as described in the tutorial except that i don't have an build . in the docker compose but i push an image into my own container registry before it and then use that image.
So this is my docker-compose file:
version: '3'
services:
strapi:
container_name: strapi
image: ghcr.io/confidato/strapi-cms:latest
restart: unless-stopped
env_file: .env
environment:
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_HOST: postgresDB
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PORT: ${DATABASE_PORT}
JWT_SECRET: ${JWT_SECRET}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
NODE_ENV: ${NODE_ENV}
links:
- postgresDB:postgresDB
volumes:
- ./public:/public/upload
#- ./src:/opt/app/src ### If this line is not in the file it starts.
ports:
- "1337:1337"
depends_on:
- postgresDB
postgresDB:
image: postgres:12.0-alpine
container_name: postgresDB
restart: unless-stopped
env_file: .env
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- ./data:/var/lib/postgresql/data/
ports:
- "5432:5432"
networks:
default:
external:
name: network123
If i start it without the line - ./src:/opt/app/src in volumes everthing looks good but if i use docker-compose down my data won't show up again in the admin-dashboard. I guess i have a problem with my volume mapping. If I add the line - ./src:/opt/app/src strapi has an error at startup and it says: Missing api folder. Please create one at './src/api'.
Any idea where my problem is?
Manuel
software