Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added in the dockerfile support #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
.git
.gitignore
node_modules
npm-debug.log
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#using Node v10
FROM node:10

#Create app directory
WORKDIR /usr/src/lafs

#Install app dependencies
#A wildcard is used to ensure both package.json AND package-lock.json are copied
#where available (npm@5+)
COPY package*.json ./
RUN npm install -g @angular/cli@v6-lts
RUN npm install
#If you are building your code for production
#RUN npm ci --only=production

#Bundle app source
COPY . .

#Expose port 3000 outside container
EXPOSE 4200
#Command used to start application
CMD ng serve --host 0.0.0.0
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.7'
services:
# Angular frontend application
app:
container_name: lafs-web
restart: always
build: .
ports:
- '4200:4200'
command: >
bash -c "npm install && ng serve --host 0.0.0.0 --port 4200"
# Attach the external network to these containers
networks:
default:
external:
name: lafs-net
77 changes: 58 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export const environment = {
production: false,
api_url: 'https://q-a-example-loopback-api.herokuapp.com'
api_url: 'http://localhost:3000'
};

/*
Expand Down