-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
90 additions
and
3 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,35 @@ | ||
# syntax = docker/dockerfile:1.4.1 | ||
|
||
FROM node:21.7.1-alpine3.19 AS payload | ||
LABEL name='api build' | ||
# enable pnpm | ||
RUN corepack enable | ||
RUN corepack prepare pnpm@8.15.5 --activate | ||
# set user and working directory and copy all project files | ||
USER node | ||
WORKDIR /home/node/workspace | ||
COPY --chown=node . . | ||
# set environment variables | ||
ENV NODE_ENV development | ||
# install node modules for plugin | ||
# RUN pnpm install | ||
# ENV PATH /home/node/workspace/node_modules/.bin:$PATH | ||
# build plugin | ||
# RUN pnpm run build | ||
# set working directory for test environment | ||
WORKDIR /home/node/workspace/dev | ||
# install node module for test environment | ||
RUN pnpm install | ||
ENV PATH /home/node/workspace/dev/node_modules/.bin:$PATH | ||
# set internal port | ||
EXPOSE 3000 | ||
# start test environment | ||
CMD pnpm run dev | ||
|
||
FROM mongo:7.0.6-jammy as db | ||
LABEL name='db build' | ||
# database config | ||
ENV MONGO_INITDB_ROOT_USERNAME=root | ||
ENV MONGO_INITDB_ROOT_PASSWORD=secret | ||
# set internal port | ||
EXPOSE 27017 |
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,2 @@ | ||
start: | ||
docker compose up |
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,5 @@ | ||
node_modules | ||
|
||
.gitignore | ||
|
||
Makefile |
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 @@ | ||
node_modules |
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,2 @@ | ||
gen: | ||
export PAYLOAD_CONFIG_PATH=src/config/payload.config.ts && pnpm run generate:types |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: '3.9' | ||
|
||
services: | ||
|
||
#api development build | ||
payload: | ||
build: | ||
target: payload | ||
image: payload:dev | ||
ports: | ||
- target: 3000 | ||
published: 80 | ||
protocol: tcp | ||
mode: host | ||
depends_on: | ||
- db | ||
restart: unless-stopped | ||
#enabling hot reload by binding the project folder | ||
volumes: | ||
- type: bind | ||
source: ./ | ||
target: /home/node/workspace | ||
|
||
|
||
#db development build | ||
db: | ||
build: | ||
target: db | ||
image: db:dev | ||
restart: unless-stopped | ||
volumes: | ||
- type: volume | ||
source: data | ||
target: /data/db | ||
|
||
networks: | ||
default: | ||
name: workspace-dev | ||
|
||
volumes: | ||
data: | ||
name: workspace-vol-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