Skip to content

Commit

Permalink
fix env
Browse files Browse the repository at this point in the history
  • Loading branch information
itsumura-h committed Oct 11, 2024
1 parent 4bad067 commit 6e77e5a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 57 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/nim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ jobs:
runs-on: ubuntu-latest
needs: before
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Build docker image
run: docker compose -f compose.test.yaml build app-ubuntu-v1
- name: Test
run: docker compose -f compose.test.yaml run app-ubuntu-v1 nimble test

test-on-docker-nim-v2:
runs-on: ubuntu-latest
needs: before
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Build docker image
run: docker compose -f compose.test.yaml build app-ubuntu-v2
- name: Test
run: docker compose -f compose.test.yaml run app-ubuntu nimble test
run: docker compose -f compose.test.yaml run app-ubuntu-v2 nimble test


# アプリケーションの方を使うことにした
Expand Down
13 changes: 5 additions & 8 deletions compose.test.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
version: '3'
services:
app-ubuntu-v1:
build:
context: .
dockerfile: ./docker/ubuntu/Dockerfile
dockerfile: ./docker/ubuntu/test.Dockerfile
args:
VERSION: 1.6.16
tty: true
NIM_VERSION: 1.6.20
volumes:
- .:/root/project
depends_on:
Expand All @@ -15,13 +13,12 @@ services:
- mariadb
- surreal

app-ubuntu:
app-ubuntu-v2:
build:
context: .
dockerfile: ./docker/ubuntu/Dockerfile
dockerfile: ./docker/ubuntu/test.Dockerfile
args:
VERSION: 2.0.0
tty: true
NIM_VERSION: 2.2.0
volumes:
- .:/root/project
depends_on:
Expand Down
31 changes: 3 additions & 28 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
version: '3'
services:
# app-alpine:
# build:
# context: .
# dockerfile: ./docker/alpine/Dockerfile
# tty: true
# environment:
# TZ: Asia/Tokyo
# volumes:
# - .:/root/project
# depends_on:
# - mariadb
# - postgres

app-ubuntu:
build:
context: .
dockerfile: ./docker/ubuntu/Dockerfile
args:
# VERSION: 1.6.14
VERSION: 2.0.0
NIM_VERSION: 2.2.0
tty: true
volumes:
- .:/root/project
Expand Down Expand Up @@ -69,7 +55,7 @@ services:
image: adminer:4.8.1-standalone
tty: true
ports:
- 9002:8080
- 9001:8080
depends_on:
- mysql
- mariadb
Expand All @@ -79,19 +65,8 @@ services:
build: ./docker/adminer
tty: true
ports:
- 9003:8080
- 9002:8080
volumes:
- ./:/app
depends_on:
- app-ubuntu

phpmyadmin:
image: phpmyadmin
tty: true
environment:
- PMA_ARBITRARY=1
ports:
- "9004:80"
depends_on:
- mysql
- mariadb
40 changes: 23 additions & 17 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

# prevent timezone dialogue
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update; apt install -y libgnutls30
RUN apt update; \
apt upgrade -y
RUN apt update
RUN apt upgrade -y
RUN apt install -y \
gcc \
xz-utils \
ca-certificates \
vim \
curl \
wget \
git \
sqlite3 \
libpq-dev \
libmariadb-dev
gcc \
xz-utils \
ca-certificates \
vim \
curl \
git \
sqlite3 \
libpq-dev \
libmariadb-dev

# ===== Nim =====
ARG VERSION="2.0.0"
# Nim
ARG NIM_VERSION="2.0.0"
WORKDIR /root
RUN curl https://nim-lang.org/choosenim/init.sh -o init.sh
RUN sh init.sh -y
RUN rm -f init.sh
ENV PATH $PATH:/root/.nimble/bin
RUN choosenim ${VERSION}
RUN choosenim ${NIM_VERSION}

# nimlangserver
WORKDIR /root
RUN curl -o nimlangserver.tar.gz -L https://github.com/nim-lang/langserver/releases/download/v1.6.0/nimlangserver-1.6.0-linux-amd64.tar.gz
RUN tar zxf nimlangserver.tar.gz
RUN rm -f nimlangserver.tar.gz
RUN mv nimlangserver /root/.nimble/bin/

WORKDIR /root/project
COPY ./allographer.nimble .
RUN nimble install -y -d

RUN git config --global --add safe.directory /root/project
32 changes: 32 additions & 0 deletions docker/ubuntu/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:24.04

# prevent timezone dialogue
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update
RUN apt upgrade -y
RUN apt install -y \
gcc \
xz-utils \
ca-certificates \
git \
sqlite3 \
libpq-dev \
libmariadb-dev

# Nim
ARG NIM_VERSION="2.0.0"
WORKDIR /root
RUN curl https://nim-lang.org/choosenim/init.sh -o init.sh
RUN sh init.sh -y
RUN rm -f init.sh
ENV PATH $PATH:/root/.nimble/bin
RUN choosenim ${NIM_VERSION}

WORKDIR /root/project
COPY ./allographer.nimble .
RUN nimble install -y -d

RUN git config --global --add safe.directory /root/project

WORKDIR /root/project
2 changes: 1 addition & 1 deletion permission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ local_GID=$(id -g $USER)
echo 'start'
sudo chown ${local_UID}:${local_GID} * -R
echo '======================'
sudo chown ${local_UID}:${local_GID} .git -R
sudo chown ${local_UID}:${local_GID} .* -R
echo 'end'

0 comments on commit 6e77e5a

Please sign in to comment.