Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Graphics generator
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
to-generator
Graphics generator
Commits
27540810
Commit
27540810
authored
Apr 2, 2023
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
update Dockerfile
parent
8f817629
No related branches found
No related tags found
No related merge requests found
Pipeline
#12173
passed
Apr 2, 2023
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+12
-26
12 additions, 26 deletions
Dockerfile
docker-compose.yml
+0
-25
0 additions, 25 deletions
docker-compose.yml
with
12 additions
and
51 deletions
Dockerfile
+
12
−
26
View file @
27540810
# syntax=docker/dockerfile:3
FROM
python:3.10
# https://sourcery.ai/blog/python-docker/
# Thanks to Brendan Maginnis!
RUN
mkdir
/app
WORKDIR
/app
FROM
python:3.10
as
base
RUN
curl
-fsSL
https://deb.nodesource.com/setup_19.x | bash -
RUN
apt-get
install
nodejs
&&
rm
-rf
/var/lib/apt/lists/
*
# Setup env
ENV
LANG C.UTF-8
ENV
LC_ALL C.UTF-8
ENV
PYTHONDONTWRITEBYTECODE 1
ENV
PYTHONFAULTHANDLER 1
ENV
DEBIAN_FRONTEND noninteractive
FROM
base
AS
python-deps
COPY
. .
# Install pipenv and compilation dependencies
RUN
pip
install
-U
virtualenv pipenv
...
...
@@ -25,19 +19,11 @@ COPY Pipfile.lock .
RUN
PIPENV_VENV_IN_PROJECT
=
1 pipenv
install
--deploy
RUN
PIPENV_VENV_IN_PROJECT
=
1 pipenv
install
gunicorn
FROM
base
AS
runtime
# Copy virtual env from python-deps stage
COPY
--from=python-deps /.venv /.venv
ENV
PATH="/.venv/bin:$PATH"
# Create and switch to a new user
RUN
useradd
--create-home
appuser
WORKDIR
/home/appuser
USER
appuser
RUN
bash
-c
"adduser --disabled-login --quiet --gecos app app &&
\
chmod -R o+r /app/ &&
\
chmod o+x /app/run.sh"
USER
app
# Install application into container
COPY
. .
# Expose 8080
EXPOSE
8080
CMD
["bash", "run.sh"]
This diff is collapsed.
Click to expand it.
docker-compose.yml
deleted
100644 → 0
+
0
−
25
View file @
8f817629
version
:
"
3"
services
:
generator
:
image
:
ppm
environment
:
FLASK_APP
:
generator
FLASK_DEBUG
:
0
DATABASE_URL
:
"
postgresql://username:password@host/database_name"
SECRET_KEY
:
"
Åìo«ÑÚ2ûÁn-Û?bV4«Û©ä´ó>°yÆvw7°Ôa"
JWT_SECRET_KEY
:
"
¤2¯µ&ñðxÈF?a^µ#udbLxgЧ?ÅÏARA®D"
JWT_EXPIRES_AFTER
:
604800
OIDC_BASE_URL
:
http://localhost:8080/auth/realms/master/
OIDC_CLIENT_ID
:
generator
OIDC_CLIENT_SECRET
:
"
a11a5557-d486-429c-8c8c-7afa0bf1b0be"
ports
:
-
"
8080:5010"
command
:
[
"
/bin/bash"
,
"
./run.sh"
]
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