0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

🔥 Remove docker/backend and docker/frontend.

They are moved to uxbox-ansible repository that
will be open-sourced soon.
This commit is contained in:
Andrey Antukh 2020-01-20 16:20:10 +01:00
parent 5ac5142b67
commit 2390735164
7 changed files with 0 additions and 248 deletions

View file

@ -1,39 +0,0 @@
FROM debian:buster
LABEL maintainer="Andrey Antukh <niwi@niwi.nz>"
ENV CLOJURE_VERSION=1.10.1.492 \
LANG=en_US.UTF-8 \
LC_ALL=C.UTF-8
RUN set -ex; \
apt-get update -yq && \
apt-get install -yq \
curl \
wget \
rsync \
git \
vim \
rlwrap \
openjdk-11-jdk \
imagemagick \
webp
RUN set -ex; \
wget "https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh"; \
chmod +x "linux-install-$CLOJURE_VERSION.sh"; \
"./linux-install-$CLOJURE_VERSION.sh"; \
rm -rf "linux-install-$CLOJURE_VERSION.sh"
COPY ./entrypoint.sh /entrypoint.sh
COPY ./dist /srv/uxbox
RUN set -ex; \
chmod 755 /entrypoint.sh; \
mkdir /srv/uxbox/data;
WORKDIR /srv/uxbox/
EXPOSE 6060
ENTRYPOINT ["bash", "/entrypoint.sh"]
CMD ["/srv/uxbox/bin/start-prod"]

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -e
echo "Synchronize static data..."
rsync -avr --delete ./resources/public/static/ ./data/static/
if [ -z "$UXBOX_DATABASE_URI" ]; then
echo "Initializing database connection string..."
UXBOX_DATABASE_URI="\"postgresql://$(echo ${UXBOX_DATABASE_SERVER} | tr -d '"'):${UXBOX_DATABASE_PORT}/$(echo ${UXBOX_DATABASE_NAME} | tr -d '"')\""
echo "Database connection string: $UXBOX_DATABASE_URI"
fi
echo "Setting up UXBOX Backend..."
exec "$@"

View file

@ -1,98 +0,0 @@
version: "3"
volumes:
backend_m2:
backend_data:
postgres_data:
networks:
default:
driver: bridge
ipam:
config:
- subnet: 172.177.10.0/24
services:
postgres:
image: postgres:12
restart: always
stop_signal: SIGINT
ports:
- 5432:5432
environment:
- POSTGRES_INITDB_ARGS="--data-checksums"
- POSTGRES_DB=uxbox
- POSTGRES_USER=uxbox
- POSTGRES_PASSWORD=uxbox_postgres_password
volumes:
- postgres_data:/var/lib/postgresql/data
backend:
image: uxbox-backend:latest
restart: always
depends_on:
- postgres
- smtp
ports:
- 6060
volumes:
- backend_data:/srv/uxbox/data
- backend_m2:/root/.m2
environment:
# HTTP setup
# - CLOJURE_OPTIONS=
- UXBOX_HTTP_SERVER_CORS="*"
# Media & Assets
- UXBOX_MEDIA_URI="/media/"
- UXBOX_ASSETS_URI="/static/"
- UXBOX_MEDIA_DIRECTORY="data/media"
- UXBOX_ASSETS_DIRECTORY="data/static"
# Database setup (using the `postgres` container)
- UXBOX_DATABASE_URI="postgresql://postgres/uxbox"
- UXBOX_DATABASE_USERNAME="uxbox"
- UXBOX_DATABASE_PASSWORD="uxbox_postgres_password"
# Mail setup
- UXBOX_EMAIL_REPLY_TO="no-reply@uxbox.io"
- UXBOX_EMAIL_FROM="no-reply@uxbox.io"
# STMP setup (using the `smtp` container)
- UXBOX_SMTP_HOST="smtp"
- UXBOX_SMTP_PORT=25
- UXBOX_SMTP_USER="uxbox"
# - UXBOX_SMTP_PASSWORD=""
- UXBOX_SMTP_SSL=false
- UXBOX_SMTP_TLS=false
- UXBOX_SMTP_ENABLED=false
frontend:
image: uxbox-frontend:latest
restart: always
depends_on:
- backend
ports:
- 8080:8080
volumes:
- backend_data:/srv/uxbox/
frontend-dev:
image: uxbox-frontend-dbg:latest
restart: always
depends_on:
- backend
ports:
- 8081:8080
volumes:
- backend_data:/srv/uxbox/
smtp:
image: mwader/postfix-relay
restart: always
environment:
- POSTFIX_myhostname=smtp.uxbox.io
- OPENDKIM_DOMAINS=smtp.uxbox.io

View file

@ -1,11 +0,0 @@
FROM nginx:1.17.7
LABEL maintainer="Andrey Antukh <niwi@niwi.nz>"
ENV LANG=en_US.UTF-8 \
LC_ALL=C.UTF-8
# Copy built app to www root
COPY ./dist /usr/share/nginx/html
# NGINX configurations
COPY ./nginx/conf.d /etc/nginx/conf.d

View file

@ -1,40 +0,0 @@
# Setting up NGNIX
You will need to complete the following tasks to setup your dockerized proxy server:
1. Include/Create SSL keys
2. Alter your backend upstream
3. Confirm your backend's path
## Include/Create SSL Keys
Have your key and csr in the nginx/keys directory as server.key and server.crt. These are copied into the docker image on build and used to serve your website or proxy your services.
### Generate your own self signed certificate
```bash
openssl req \
-newkey rsa:2048 -nodes -keyout nginx/keys/server.key \
-x509 -out nginx/keys/server.crt
```
This command from your project root will create the keys needed to start docker with self signed certificates. Note that if you are going to deploy this site for production you will want to replace these and rebuild your image with valid (purchased) SSL certificates. All the fields are optional. Do not set any challenge passwords.
If you want validated certificates but are not looking to purchase them; then checkout [Let's Encrypt](https://letsencrypt.org) which is a free SSL certification service.
## Alter your backend upstream
The upstream is a block used to load balance different destinations important to your proxy. In this example the upstream is used to proxy requests to your backend without worrying about XSS configurations.
We have preloaded some examples of what this looks like in the `nginx/conf.d/default.conf` file. You can certainly only specify one server in the block if that is your only server.
## Confirm your backend's path
Assuming your website uses a backend collection of APIs, you can setup your nginx service to reverse proxy to them avoiding any XSS configuration needs. The provided default.conf includes a `/api/` location block to serve as an example. You can replace api in `/api/` with any path you want to have forwarded to your backend.
There is only one setting you need to adjust in this block and that is the `proxy_cookie_domain`. Assuming you have a production domain you would change `my.uxbox.com` to be your domain. If you do not have a production domain it is safe to leave this as is or delete.
## Extending the configuration
You can include more servers or configuration settings by adding any named file in `nginx/conf.d`. These files are automatically consumed by nginx on startup.
[Visit NGINX's beginnner's guide](http://nginx.org/en/docs/beginners_guide.html) for additional help.

View file

@ -1,43 +0,0 @@
server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name _;
gzip on;
gzip_static on;
gzip_proxied any;
gzip_types text/plain text/html text/css text/javascript application/javascript application/json application/transit+json;
# Frontend
location / {
root /usr/share/nginx/html/;
try_files $uri /index.html;
add_header Cache-Control "max-age=15552000" always;
}
location /view {
alias /usr/share/nginx/html/view;
}
location /media {
alias /srv/uxbox/media;
}
location /static {
alias /srv/uxbox/static;
}
# Backend
location /api/ {
proxy_pass http://backend:6060/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

View file

@ -1,3 +0,0 @@
log_format gzip '[$time_local] ' '"$request" $status $bytes_sent';
access_log /dev/stdout;
charset utf-8;