Skip to content

Instantly share code, notes, and snippets.

@masterxavierfox
Last active May 25, 2020 18:19
Show Gist options
  • Save masterxavierfox/070745c36346ddee9bbc7d42c6549558 to your computer and use it in GitHub Desktop.
Save masterxavierfox/070745c36346ddee9bbc7d42c6549558 to your computer and use it in GitHub Desktop.
Dockerfiles and compose
PGDATA
node_modules
npm-debug.log
.dockerignore
Dockerfile
.dockerignore
Dockerfile
node_modules
build
version: '3.7'
services:
postgres:
image: kartoza/postgis:12.0
ports:
- 5432:5432
volumes:
- $PWD/PGDATA:/var/lib/postgresql/12/main
environment:
- POSTGRES_USER=postgres
- PGUSER=postgres
- POSTGRES_PASS=password
- PGPASSWORD=password
- POSTGRES_DBNAME=ictlife_infra_interview_may_2020
- PGDATABASE=ictlife_infra_interview_may_2020
- PGHOST=localhost
- ALLOW_IP_RANGE=0.0.0.0/0
backend:
image: masterfox/demo:backend
ports:
- 3001:3001
depends_on:
- postgres
frontend:
image: masterfox/demo:frontend
ports:
- 3000:3000
depends_on:
- backend
FROM node:10
ENV PORT 3000
EXPOSE 3000
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json .
RUN yarn install
COPY . .
CMD ["yarn", "start"]
FROM golang:1.12.0
RUN apt-get update
RUN apt-get install -y git python jq curl
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash -
RUN apt-get update && apt-get install -y nodejs
RUN go get -u github.com/pressly/goose/cmd/goose
RUN mkdir -p /apps/backend
WORKDIR /app/backend
COPY . .
RUN npm install --silent
RUN npm install -g gulp-cli && npm install [email protected]
COPY . .
RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && chmod +x wait-for-it.sh
ENTRYPOINT ./wait-for-it.sh postgres:5432 -- goose postgres "postgres://postgres:password@postgres:5432/ictlife_infra_interview_may_2020" status && gulp server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment