add docker dev/prod variants
This commit is contained in:
parent
960ccfc994
commit
2cda8b607e
|
@ -1,7 +1,7 @@
|
|||
# package management
|
||||
node_modules
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
pnpm-lock.yml
|
||||
yarn.lock
|
||||
|
||||
# env
|
||||
|
@ -9,3 +9,7 @@ yarn.lock
|
|||
|
||||
# code
|
||||
!*.js
|
||||
|
||||
# docker
|
||||
docker-compose.yml
|
||||
Dockerfile
|
|
@ -0,0 +1,11 @@
|
|||
FROM node:19
|
||||
|
||||
WORKDIR /opt/code
|
||||
|
||||
COPY . /opt/code
|
||||
|
||||
RUN cat .gitignore | xargs rm -rf && \
|
||||
npm i && \
|
||||
./install
|
||||
|
||||
CMD [ "npm", "run", "dev" ]
|
|
@ -0,0 +1,11 @@
|
|||
FROM node:19
|
||||
|
||||
WORKDIR /opt/code
|
||||
|
||||
COPY . /opt/code
|
||||
|
||||
RUN cat .gitignore | xargs rm -rf && \
|
||||
npm i --prod && \
|
||||
./install
|
||||
|
||||
CMD [ "npm", "run", "prod" ]
|
|
@ -0,0 +1,47 @@
|
|||
version: '3'
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- './:/opt/code'
|
||||
ports:
|
||||
- '${APP_PORT}:${APP_PORT}'
|
||||
- '9229:9229'
|
||||
env_file: ./.env
|
||||
environment:
|
||||
APP_PORT: '${APP_PORT}'
|
||||
networks:
|
||||
- homepage
|
||||
redis:
|
||||
image: redis:alpine
|
||||
ports:
|
||||
- '6379:6379'
|
||||
networks:
|
||||
- homepage
|
||||
db:
|
||||
image: postgres:alpine
|
||||
ports:
|
||||
- '5432:5432'
|
||||
environment:
|
||||
POSTGRES_PASSWORD: '${DB_PASSWORD}'
|
||||
POSTGRES_USER: '${DB_USERNAME}'
|
||||
POSTGRES_DB: '${DB_DATABASE}'
|
||||
volumes:
|
||||
- './data/db:/var/lib/postgresql'
|
||||
networks:
|
||||
- homepage
|
||||
adminer:
|
||||
image: adminer:standalone
|
||||
ports:
|
||||
- '8001:8080'
|
||||
networks:
|
||||
- homepage
|
||||
environment:
|
||||
ADMINER_DEFAULT_SERVER: postgres
|
||||
ADMINER_DESIGN: rmsoft
|
||||
|
||||
networks:
|
||||
homepage:
|
||||
driver: bridge
|
Loading…
Reference in New Issue