This guide describes how to install and run the Drawing Captcha App using Docker Compose on your server.
- Docker installed: Docker Installation Guide
- Docker Compose installed: Docker Compose Installation Guide
Create a file named docker-compose.yml
with the following content:
version: "3.8"
services:
dc_node:
container_name: dc_node
image: williamspesic/drawing-captcha-app:latest
ports:
- 9091:9091
networks:
- dc_network
- nginx_default
depends_on:
- dc_mongo
restart: always
environment:
MONGO_URI: ${MONGO_URI}
PORT: ${PORT}
SERVER_DOMAIN: ${SERVER_DOMAIN}
REGISTER_KEY: ${REGISTER_KEY}
DC_ADMIN_EMAIL: ${DC_ADMIN_EMAIL}
DC_ADMIN_PASSWORD: ${DC_ADMIN_PASSWORD}
EMAIL_SERVICE: ${EMAIL_SERVICE}
EMAIL_FROM: ${EMAIL_FROM}
SMTPAUTH_EMAIL_HOST: ${SMTPAUTH_EMAIL_HOST}
SMTPAUTH_EMAIL_PORT: ${SMTPAUTH_EMAIL_PORT}
SMTPAUTH_EMAIL_USER: ${SMTPAUTH_EMAIL_USER}
SMTPAUTH_EMAIL_PASS: ${SMTPAUTH_EMAIL_PASS}
POSTMARK_SERVER_CLIENT: ${POSTMARK_SERVER_CLIENT}
POSTMARK_MESSAGE_STREAM: ${POSTMARK_MESSAGE_STREAM}
BASIC_AUTH: ${BASIC_AUTH}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
MICROSOFT_CLIENT_ID: ${MICROSOFT_CLIENT_ID}
MICROSOFT_CLIENT_SECRET: ${MICROSOFT_CLIENT_SECRET}
dc_mongo:
container_name: dc_mongo
image: mongo:latest
expose:
- "27017"
volumes:
- drawing-captcha:/data/db
networks:
- dc_network
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
networks:
dc_network:
nginx_default:
external: true
volumes:
drawing-captcha:
Create a .env
file in the same directory and add the following content:
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=zTU?e5ko798u0$s?3iY4^eUZvv.
MONGO_INITDB_DATABASE=drawing-captcha
MONGO_URI="mongodb://localhost:7500/drawing-captcha"
MONGO_URI="mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@dc_mongo:27017/${MONGO_INITDB_DATABASE}?authSource=admin"
SERVER_DOMAIN="https://yourdomain.com"
# Port of your server
PORT=9091
REGISTER_KEY="&&+%&%ajkhdjhWIIWNw7>dajh2gg"
DC_ADMIN_EMAIL="[email protected]"
DC_ADMIN_PASSWORD="admin"`
-
Navigate to the directory containing the
docker-compose.yml
file. -
Run the following command to start the containers:
docker-compose up -d
-
The application should now be accessible at
http://localhost:9091
(or your specified domain).
-
Ensure you change the email and password in the
.env
file before deploying the app in a production environment. -
Check Docker logs if issues arise:
docker-compose logs
- MongoDB Connection Issues: Check the
MONGO_URI
in the.env
file. - Network Issues: Ensure the
dc_network
is correctly configured.
For further questions or issues, please visit the GitHub Repository for more information.