Skip to content

Commit 07a1771

Browse files
authored
Fixing Dockerfile and upgrade packages (#48)
* Fixing dockerfile and upgrade packages * Fixed frontend jwt issue
1 parent 5682b88 commit 07a1771

File tree

19 files changed

+7356
-4494
lines changed

19 files changed

+7356
-4494
lines changed

api/composer.lock

Lines changed: 718 additions & 444 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Icon?
4141
Thumbs.db
4242

4343
# Dist #
44-
dist
4544
.awcache
4645
.webpack.json
4746
compiled

backend/Dockerfile

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,36 @@
11
#################################
2-
# STEP 1: Build
2+
# STEP 1: NPM install
33
#################################
4-
FROM node:12.10.0-alpine as build
4+
FROM node:13-alpine as initial-stage
55

6-
# Create app folder
7-
RUN mkdir /app
8-
WORKDIR /app
6+
WORKDIR /srv
97

10-
# Add path
11-
ENV PATH /app/node_modules/.bin:$PATH
8+
COPY package*.json ./
129

13-
# Copy package*.json to app folder
14-
COPY package.json package-lock.json /app/
15-
16-
# Install app dependencies
17-
RUN npm set progress=false
1810
RUN npm install
1911

20-
# Copy all files to app folder
21-
COPY . /app
12+
#################################
13+
# STEP 2: Build
14+
#################################
15+
FROM initial-stage AS build-stage
16+
17+
WORKDIR /srv
18+
19+
COPY . .
2220

23-
# Build the app
2421
RUN npm run build -- --prod --build-optimizer
2522

2623
#################################
27-
# STEP 2: Deployment
24+
# STEP 3: Deployment
2825
#################################
29-
FROM nginx:1.13.9-alpine
26+
FROM nginx:stable-alpine AS production-stage
3027

31-
# Add configuration files
3228
COPY image-files/ /
3329

34-
RUN chmod 700 /usr/local/bin/docker-entrypoint.sh
35-
36-
# Add path
37-
ENV PATH /usr/local/bin:$PATH
30+
COPY --from=build-stage /srv/dist /srv
3831

39-
# Copy dist files from build step
40-
COPY --from=build /app/dist /srv/
41-
42-
# Expose port 80
4332
EXPOSE 80
4433

45-
# Run entry point
46-
CMD ["docker-entrypoint.sh"]
34+
ENTRYPOINT [ "docker-entrypoint.sh" ]
35+
36+
CMD ["nginx", "-g", "daemon off;"]

backend/Dockerfile.dev

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
#################################
22
# Development
33
#################################
4-
FROM node:12.10.0-alpine as build
4+
FROM node:13-alpine as build-stage
55

6-
# Create app folder
7-
RUN mkdir /app
86
WORKDIR /app
97

10-
# Copy package*.json to app folder
11-
COPY package.json package-lock.json /app/
8+
COPY package*.json ./
129

1310
# Install app dependencies
1411
RUN npm install -g @angular/cli
1512
RUN npm set progress=false
1613
RUN npm install
1714

1815
# Copy all files to app folder
19-
COPY . /app
16+
COPY . .
2017

2118
# Add configuration files
2219
COPY image-files/ /
23-
RUN chmod 700 /usr/local/bin/docker-entrypoint-dev.sh
2420

2521
# Install nginx
2622
RUN apk --update add nginx
2723

2824
# Expose port 80
2925
EXPOSE 80
26+
3027
ENTRYPOINT ["docker-entrypoint-dev.sh"]
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/sh
22

3-
printf "Starting nginx...\n\n"
4-
nginx -g "daemon off;"
3+
echo ' _____ .__ '
4+
echo ' / _ \ ____ ____ __ __| | _____ _______ '
5+
echo ' / /_\ \ / \ / ___\| | \ | \__ \\_ __ \'
6+
echo '/ | \ | \/ /_/ > | / |__/ __ \| | \/'
7+
echo '\____|__ /___| /\___ /|____/|____(____ /__| '
8+
echo ' \/ \//_____/ \/ '
59

10+
exec "$@"

0 commit comments

Comments
 (0)