Skip to content

Instantly share code, notes, and snippets.

@cayblood
Last active February 15, 2023 20:02
Show Gist options
  • Save cayblood/e2d7e98b15eea241b3f662a959ec1dd5 to your computer and use it in GitHub Desktop.
Save cayblood/e2d7e98b15eea241b3f662a959ec1dd5 to your computer and use it in GitHub Desktop.
version: '3.9'
services:
remix:
build:
context: .
dockerfile: Dockerfile.dev
depends_on:
- mail
- hanko-backend
env_file: ./.env
environment:
PORT: 8888
HANKO_URL: http://localhost:8000
SESSION_SECRET: secret-password-12345
networks:
- intranet
ports:
- "8888:8888"
- "8002:8002"
restart: "no"
volumes:
- ../app:/myapp/app
mail:
image: mailhog/mailhog
ports:
- "8025:8025"
networks:
- intranet
# from https://github.com/teamhanko/hanko/blob/main/deploy/docker-compose/quickstart.yaml
hanko-database:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- hanko_db_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U postgres -d postgres
interval: 10s
timeout: 10s
retries: 3
start_period: 30s
networks:
- intranet
hanko-backend:
image: ghcr.io/teamhanko/hanko:v0.4.0
depends_on:
hanko-migrate:
condition: service_completed_successfully
volumes:
- ./hanko.yml:/config/config.yaml
command: serve all
ports:
- "8000:8000" # public
- "8001:8001" # admin
networks:
- intranet
hanko-migrate:
command: migrate up
depends_on:
hanko-database:
condition: service_healthy
image: ghcr.io/teamhanko/hanko:v0.4.0
networks:
- intranet
volumes:
- ./hanko.yml:/config/config.yaml
volumes:
hanko_db_data:
myapp:
external: true
networks:
intranet:
FROM node:18-bullseye-slim
WORKDIR /myapp
# set for base and all layer that inherit from it
ENV NODE_ENV development
ENV PORT 8888
ENV DATABASE_URL file:./data.db?connection_limit=1
# Install openssl for Prisma
RUN apt-get update && apt-get upgrade -y && apt-get install -y openssl sqlite3
# Install all node_modules, including dev dependencies
ADD package.json .npmrc ./
RUN npm install
ADD . ./
RUN npx prisma migrate reset --force
RUN npm run build
CMD ["npm", "run", "dev"]
audit_log:
console_output:
enabled: true
output: stdout
storage:
enabled: false
database:
dialect: postgres
host: hanko-database
port: 5432
user: postgres
password: postgres
database: postgres
passcode:
email:
from_address: noreply@yourdomain.com
smtp:
host: mail
port: 1025
session:
enable_auth_token_header: true
lifespan: '24h'
cookie:
secure: false
secrets:
keys:
- secret-password-12345
server:
admin:
address: ':8001'
public:
address: ':8000'
cors:
enabled: true
allow_credentials: true
allow_origins:
- '*'
service:
name: Hanko Authentication Service
webauthn:
relying_party:
id: localhost
display_name: Hanko Authentication Service
origin: http://localhost:8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment