Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Librephotos Docker Scaling
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dev Ops
Librephotos Docker Scaling
Commits
2f971087
Commit
2f971087
authored
3 years ago
by
Akshay Naik
Browse files
Options
Downloads
Patches
Plain Diff
Optimize Frontend Docker Image
parent
7a1ff44c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docker-compose.dev.yml
+1
-2
1 addition, 2 deletions
docker-compose.dev.yml
frontend/Dockerfile
+9
-5
9 additions, 5 deletions
frontend/Dockerfile
frontend/Dockerfile.dev
+15
-0
15 additions, 0 deletions
frontend/Dockerfile.dev
frontend/entrypoint.sh
+1
-9
1 addition, 9 deletions
frontend/entrypoint.sh
with
26 additions
and
16 deletions
docker-compose.dev.yml
+
1
−
2
View file @
2f971087
...
@@ -32,10 +32,9 @@ services:
...
@@ -32,10 +32,9 @@ services:
-
DEBUG=1
-
DEBUG=1
build
:
build
:
context
:
./frontend
context
:
./frontend
dockerfile
:
Dockerfile
dockerfile
:
Dockerfile
.dev
volumes
:
volumes
:
-
${codedir}/librephotos-frontend:/usr/src/app
-
${codedir}/librephotos-frontend:/usr/src/app
-
./frontend/entrypoint.sh:/entrypoint.sh
backend
:
backend
:
tty
:
true
tty
:
true
...
...
This diff is collapsed.
Click to expand it.
frontend/Dockerfile
+
9
−
5
View file @
2f971087
FROM
node:13-slim
FROM
node:13-slim
as
builder
RUN
apt-get update
&&
apt-get
install
-y
curl git xsel
RUN
apt-get update
&&
apt-get
install
-y
git
RUN
mkdir
-p
/usr/src/app
RUN
mkdir
-p
/usr/src/app
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
RUN
npm
install
-g
serve
ENV
CLI_WIDTH 80
ENV
CLI_WIDTH 80
RUN
git clone https://github.com/LibrePhotos/librephotos-frontend /usr/src/app
RUN
git clone https://github.com/LibrePhotos/librephotos-frontend /usr/src/app
RUN
npm
install
--legacy-peer-deps
RUN
npm
install
--legacy-peer-deps
RUN
npm run build
RUN
npm run build
FROM
halverneus/static-file-server
ENV
PORT 3000
EXPOSE
3000
EXPOSE
3000
COPY
entrypoint.sh /entrypoint.sh
CMD
["/entrypoint.sh"]
COPY
--from=builder /usr/src/app/build /web
ENTRYPOINT
["/serve"]
CMD
[]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/Dockerfile.dev
0 → 100644
+
15
−
0
View file @
2f971087
FROM node:13-slim
# RUN apt-get update && apt-get install -y curl git xsel
# RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# RUN npm install -g serve
# ENV CLI_WIDTH 80
# RUN git clone https://github.com/LibrePhotos/librephotos-frontend /usr/src/app
# RUN npm install --legacy-peer-deps
# RUN npm run build
EXPOSE 3000
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
This diff is collapsed.
Click to expand it.
frontend/entrypoint.sh
+
1
−
9
View file @
2f971087
...
@@ -2,14 +2,6 @@
...
@@ -2,14 +2,6 @@
echo
"installing frontend"
echo
"installing frontend"
npm
install
--legacy-peer-deps
npm
install
--legacy-peer-deps
npm run start
echo
"serving frontend"
if
[
"
$DEBUG
"
=
1
]
then
echo
"develompent running frontend"
npm run start
else
echo
"productions running frontend"
serve build
-d
-l
3000
fi
# DANGEROUSLY_DISABLE_HOST_CHECK=true HOST=0.0.0.0 npm start
# DANGEROUSLY_DISABLE_HOST_CHECK=true HOST=0.0.0.0 npm start
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment