Skip to content
Permalink
Browse files
Let frontend tests talk to the backend
  • Loading branch information
jdleesmiller committed May 24, 2020
1 parent 517f458 commit 60be4f35e05e6d52acd0ab2df05138a9d5ed26c5
Showing 7 changed files with 1,712 additions and 46 deletions.
@@ -1,11 +1,9 @@
#
# Backend for Development
# Common Dependencies
#
FROM node:12 AS development-backend
FROM node:12 AS base

RUN mkdir -p /srv/todo/backend &&\
mkdir -p /srv/todo/storage &&\
chown -R node:node /srv/todo
RUN mkdir -p /srv/todo/storage && chown -R node:node /srv/todo

USER node

@@ -15,6 +13,13 @@ COPY --chown=node:node storage/package.json storage/package-lock.json ./

RUN npm install --quiet

#
# Backend for Development
#
FROM base AS development-backend

RUN mkdir /srv/todo/backend

WORKDIR /srv/todo/backend

COPY --chown=node:node backend/package.json backend/package-lock.json ./
@@ -24,11 +29,9 @@ RUN npm install --quiet
#
# Frontend for Development
#
FROM node:12 AS development-frontend
FROM base AS development-frontend

RUN mkdir -p /srv/todo/frontend/dist && chown -R node:node /srv/todo

USER node
RUN mkdir /srv/todo/frontend

WORKDIR /srv/todo/frontend

@@ -1 +1,7 @@
version: '3.7'

services:
frontend:
environment:
DATABASE_URL: postgres://postgres:postgres@postgres/test
BASE_URL: http://backend:8080
@@ -36,6 +36,8 @@ services:
volumes:
- ./frontend:/srv/todo/frontend
- frontend_node_modules:/srv/todo/frontend/node_modules
- ./storage:/srv/todo/storage
- storage_node_modules:/srv/todo/storage/node_modules

# Use the node_modules volumes set up in the shared compose file.
volumes:

0 comments on commit 60be4f3

Please sign in to comment.