Created
September 26, 2019 22:23
-
-
Save ezy/08e5e7ef47da36badf55440c5cf22b43 to your computer and use it in GitHub Desktop.
SailsJS on docker with docker-compose
This file contains hidden or 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
version: '3' | |
services: | |
sailsjs: | |
restart: always | |
build: . | |
environment: | |
NODE_ENV: development | |
PG_HOST: postgres | |
PG_USER: postgres | |
PG_PASSWORD: postgres | |
PG_DATABASE: db_name | |
ports: | |
- 1337:1337 | |
depends_on: | |
- postgres | |
volumes: | |
- .:/usr/src/app/ | |
- /usr/src/app/node_modules | |
command: node app.js | |
postgres: | |
image: postgres:11 | |
ports: | |
- 5432:5432 | |
volumes: | |
- ./database:/var/lib/postgresql | |
- .database/init:/docker-entrypoint-initdb.d | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: db_name |
This file contains hidden or 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
FROM node:10-alpine | |
EXPOSE 1337 | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
COPY package.json . | |
RUN npm install -g sails | |
RUN npm install | |
COPY . . | |
RUN ls | |
RUN echo $PWD | |
RUN node -v | |
RUN npm -v | |
CMD npm run start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment