Skip to content

Commit

Permalink
Updated docker compose example and fixed dockerfile for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
sellnat77 committed Apr 8, 2020
1 parent 866e3a7 commit adc5ed3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ RUN npm config set registry http://registry.npmjs.org/ && npm install --silent
WORKDIR /usr/src/app
COPY . /usr/src/app/
RUN cp -a /tmp/node_modules /usr/src/app/
RUN webpack
#RUN webpack
ENV NODE_ENV=production
ENV PORT=3000
ENV REACT_APP_MAPBOX_TOKEN=REDACTED
RUN ls
CMD [ "node", "server.js" ]
CMD [ "sh", "copyEnv.sh"]
EXPOSE 3000
18 changes: 13 additions & 5 deletions Orchestration/docker-compose-example.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
version: '3.1'
version: '3.4'

services:
backend:
build:
context: ../server
image: docker.pkg.github.com/hackforla/311-data/backend:0.0.1
# build:
# context: ../server
image: docker.pkg.github.com/hackforla/311-data/backend:efdd561e412d78a9a97a074abdb3b73f28e108ce
restart: always
container_name: "311-backend"
environment:
DB_CONNECTION_STRING: postgresql://REDACTED:REDACTED@db:5432/postgres
PROJECT_URL: REDACTED
GITHUB_TOKEN: REDACTED
TOKEN: REDACTED
ports:
- 5000:5000

frontend:
build:
context: ..
image: docker.pkg.github.com/hackforla/311-data/frontend:0.0.1
network_mode: host
image: docker.pkg.github.com/hackforla/311-data/frontend:efdd561e412d78a9a97a074abdb3b73f28e108ce
restart: always
container_name: "311-frontend"
environment:
REACT_APP_MAPBOX_TOKEN: REDACTED
DB_URL: http://localhost:5000
BASE_URL: ''
ports:
- 3000:3000

Expand Down
5 changes: 5 additions & 0 deletions copyEnv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo REACT_APP_MAPBOX_TOKEN=$REACT_APP_MAPBOX_TOKEN > .env
echo DB_URL=$DB_URL >> .env
echo BASE_URL=$BASE_URL >> .env
webpack
node server.js

0 comments on commit adc5ed3

Please sign in to comment.