This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: docker and compose support (#55)
* chore: Add Docker configuration files and compose.yaml for local development * feat: add start command to Dockerfile * chore: Update Docker configuration and compose.yaml for local development * Update Docker configuration and compose.yaml for local development * chore: Add container_name to server service in compose.yaml * chore: Update Dockerfile image source URL * chore: Update Docker configuration and compose.yaml for local development * chore: Update Docker configuration and compose.yaml for local development * chore: Update Docker configuration and compose.yaml for local development * Update Docker configuration and compose.yaml for local development * chore: Update Docker configuration and compose.yaml for local development * chore: Update Docker configuration and compose.yaml for local development * chore: add a blank line in the end
- Loading branch information
1 parent
da1f71b
commit 6ec6312
Showing
5 changed files
with
129 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Include any files or directories that you don't want to be copied to your | ||
# container here (e.g., local build artifacts, temporary files, etc.). | ||
# | ||
# For more help, visit the .dockerignore file reference guide at | ||
# https://docs.docker.com/go/build-context-dockerignore/ | ||
|
||
**/.classpath | ||
**/.dockerignore | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/.next | ||
**/.cache | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/charts | ||
**/docker-compose* | ||
**/compose.y*ml | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
**/build | ||
**/dist | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ARG NODE_VERSION=20 | ||
|
||
FROM node:${NODE_VERSION} | ||
LABEL org.opencontainers.image.source https://github.com/eddiehubcommunity/CreatorsRegistry | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
|
||
RUN npm ci | ||
|
||
EXPOSE 3000 | ||
|
||
CMD npm run db:prod:migrate && npm run build && npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,40 @@ | ||
version: '3.9' | ||
|
||
services: | ||
|
||
server: | ||
build: | ||
context: . | ||
env_file: | ||
- .env | ||
environment: # To override the DB URL in the .env file | ||
- DATABASE_URL=postgres://postgres:password@db:5432/contentcreator?schema=public | ||
depends_on: | ||
- db | ||
ports: | ||
- 3000:3000 | ||
networks: | ||
- creators-registry | ||
container_name: server | ||
db: | ||
image: postgres | ||
container_name: creator_registry_db | ||
image: postgres:16 | ||
container_name: db | ||
networks: | ||
- creators-registry | ||
restart: always | ||
shm_size: 128mb | ||
user: postgres | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: user | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: contentcreator | ||
ports: | ||
- "5432:5432" | ||
- POSTGRES_PASSWORD=password | ||
expose: | ||
- 5432 | ||
healthcheck: | ||
test: [ "CMD", "pg_isready" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
networks: | ||
creators-registry: | ||
driver: bridge | ||
|
||
volumes: | ||
db-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
db: | ||
image: postgres:16 | ||
container_name: creator_registry_db | ||
restart: always | ||
user: postgres | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_PASSWORD=password | ||
expose: | ||
- 5432 | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: [ "CMD", "pg_isready" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
volumes: | ||
db-data: |