Skip to content

Commit

Permalink
fix: docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
v0l committed Jan 26, 2024
1 parent 3fb7b7a commit 404a07f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/node_modules
**/.pnp.*
**/.yarn/*
!**/.yarn/patches
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions
**/.idea
**/target
2 changes: 2 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ steps:
YARN_CACHE_FOLDER: /cache/.yarn-docker
NODE_CONFIG_ENV: default
commands:
- apt update && apt install -y git
- yarn install
- yarn build
- name: build docker image
Expand Down Expand Up @@ -142,6 +143,7 @@ steps:
YARN_CACHE_FOLDER: /cache/.yarn-docker-
NODE_CONFIG_ENV: default
commands:
- apt update && apt install -y git
- yarn install
- yarn build
- name: build docker image
Expand Down
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:19 as build
WORKDIR /app

COPY package.json yarn.lock .yarnrc.yml .
COPY .yarn .yarn
COPY packages packages
RUN yarn --network-timeout 1000000
RUN yarn build
FROM node:current as build
WORKDIR /src
RUN apt update \
&& apt install -y --no-install-recommends git \
&& git clone --single-branch -b main https://git.v0l.io/Kieran/snort \
&& cd snort \
&& yarn --network-timeout 1000000 \
&& yarn build

FROM nginxinc/nginx-unprivileged:mainline-alpine
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/packages/app/build /usr/share/nginx/html
COPY --from=build /src/snort/packages/app/build /usr/share/nginx/html
3 changes: 3 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ server {
server_name _;
root /usr/share/nginx/html;
index index.html;
add_header Content-Security-Policy "default-src 'self'; manifest-src *; child-src 'none'; worker-src 'self'; frame-src youtube.com www.youtube.com https://platform.twitter.com https://embed.tidal.com https://w.soundcloud.com https://www.mixcloud.com https://open.spotify.com https://player.twitch.tv https://embed.music.apple.com https://embed.wavlake.com https://challenges.cloudflare.com; style-src 'self' 'unsafe-inline'; connect-src *; img-src * data: blob:; font-src 'self'; media-src * blob:; script-src 'self' 'wasm-unsafe-eval' https://platform.twitter.com https://embed.tidal.com https://challenges.cloudflare.com";
add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;

location / {
try_files $uri $uri/ /index.html =404;
Expand Down

0 comments on commit 404a07f

Please sign in to comment.